diff --git a/composer/composer/InstalledVersions.php b/composer/composer/InstalledVersions.php index 07b32ed6ef..6d29bff66a 100644 --- a/composer/composer/InstalledVersions.php +++ b/composer/composer/InstalledVersions.php @@ -32,6 +32,11 @@ class InstalledVersions */ private static $installed; + /** + * @var bool + */ + private static $installedIsLocalDir; + /** * @var bool|null */ @@ -309,6 +314,12 @@ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); + + // when using reload, we disable the duplicate protection to ensure that self::$installed data is + // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, + // so we have to assume it does not, and that may result in duplicate data being returned when listing + // all installed packages for example + self::$installedIsLocalDir = false; } /** @@ -325,7 +336,9 @@ private static function getInstalled() $copiedLocalDir = false; if (self::$canGetVendors) { + $selfDir = strtr(__DIR__, '\\', '/'); foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + $vendorDir = strtr($vendorDir, '\\', '/'); if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { @@ -333,11 +346,14 @@ private static function getInstalled() $required = require $vendorDir.'/composer/installed.php'; self::$installedByVendor[$vendorDir] = $required; $installed[] = $required; - if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { self::$installed = $required; - $copiedLocalDir = true; + self::$installedIsLocalDir = true; } } + if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { + $copiedLocalDir = true; + } } } diff --git a/composer/composer/autoload_classmap.php b/composer/composer/autoload_classmap.php index e1694103eb..01fdf76fb0 100644 --- a/composer/composer/autoload_classmap.php +++ b/composer/composer/autoload_classmap.php @@ -61,6 +61,7 @@ 'OCA\\Richdocuments\\Migration\\Version30709Date20201111104147' => $baseDir . '/../lib/Migration/Version30709Date20201111104147.php', 'OCA\\Richdocuments\\Migration\\Version30717Date20210310164901' => $baseDir . '/../lib/Migration/Version30717Date20210310164901.php', 'OCA\\Richdocuments\\Migration\\Version50200Date20211220212457' => $baseDir . '/../lib/Migration/Version50200Date20211220212457.php', + 'OCA\\Richdocuments\\Migration\\Version9000Date20250128212050' => $baseDir . '/../lib/Migration/Version9000Date20250128212050.php', 'OCA\\Richdocuments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', 'OCA\\Richdocuments\\PermissionManager' => $baseDir . '/../lib/PermissionManager.php', 'OCA\\Richdocuments\\Preview\\EMF' => $baseDir . '/../lib/Preview/EMF.php', diff --git a/composer/composer/autoload_static.php b/composer/composer/autoload_static.php index c8786fb383..fe3ec8d7cc 100644 --- a/composer/composer/autoload_static.php +++ b/composer/composer/autoload_static.php @@ -94,6 +94,7 @@ class ComposerStaticInitRichdocuments 'OCA\\Richdocuments\\Migration\\Version30709Date20201111104147' => __DIR__ . '/..' . '/../lib/Migration/Version30709Date20201111104147.php', 'OCA\\Richdocuments\\Migration\\Version30717Date20210310164901' => __DIR__ . '/..' . '/../lib/Migration/Version30717Date20210310164901.php', 'OCA\\Richdocuments\\Migration\\Version50200Date20211220212457' => __DIR__ . '/..' . '/../lib/Migration/Version50200Date20211220212457.php', + 'OCA\\Richdocuments\\Migration\\Version9000Date20250128212050' => __DIR__ . '/..' . '/../lib/Migration/Version9000Date20250128212050.php', 'OCA\\Richdocuments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', 'OCA\\Richdocuments\\PermissionManager' => __DIR__ . '/..' . '/../lib/PermissionManager.php', 'OCA\\Richdocuments\\Preview\\EMF' => __DIR__ . '/..' . '/../lib/Preview/EMF.php', diff --git a/composer/composer/installed.php b/composer/composer/installed.php index 895ce3d035..bde7ab1c0e 100644 --- a/composer/composer/installed.php +++ b/composer/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cfd48c8ab8986bf0b444fede00b5c3f70c0f703a', + 'reference' => '198650228e624d8c27f192a8174ae0710ee5c444', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cfd48c8ab8986bf0b444fede00b5c3f70c0f703a', + 'reference' => '198650228e624d8c27f192a8174ae0710ee5c444', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), diff --git a/lib/Migration/Version2060Date20200302131958.php b/lib/Migration/Version2060Date20200302131958.php index 09bd814509..9c1ec387e9 100644 --- a/lib/Migration/Version2060Date20200302131958.php +++ b/lib/Migration/Version2060Date20200302131958.php @@ -44,7 +44,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt ]); $table->addColumn('guest_displayname', 'string', [ 'notnull' => false, - 'length' => 64, + 'length' => 255, ]); $table->addColumn('fileid', 'bigint', [ 'notnull' => true, diff --git a/lib/Migration/Version9000Date20250128212050.php b/lib/Migration/Version9000Date20250128212050.php new file mode 100644 index 0000000000..5b2d75e05b --- /dev/null +++ b/lib/Migration/Version9000Date20250128212050.php @@ -0,0 +1,39 @@ +hasTable('richdocuments_wopi')) { + return null; + } + + $table = $schema->getTable('richdocuments_wopi'); + if (!$table->hasColumn('guest_displayname')) { + return null; + } + + $column = $table->getColumn('guest_displayname'); + if ($column->getLength() === 255) { + return null; + } + + $column->setLength(255); + return $schema; + } +}