Hello Aaron Schulz, Paladox, Krinkle, jenkins-bot, I'd like you to do a code review. Please visit
https://gerrit.wikimedia.org/r/332972 to review the following change. Change subject: Revert "OutputPage: Ignore protocol-relative urls in transformResourcePath()" ...................................................................... Revert "OutputPage: Ignore protocol-relative urls in transformResourcePath()" This reverts commit d753e330a20786b8410156adfaeb0812ea85c560. Change-Id: Ifa8b010b6c38d86ea048447f836d6ecde6b1e0ad --- M includes/OutputPage.php M tests/phpunit/includes/OutputPageTest.php 2 files changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/332972/1 diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 8fe1285..211f44b 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3703,9 +3703,8 @@ } else { $remotePath = $remotePathPrefix; } - if ( strpos( $path, $remotePath ) !== 0 || substr( $path, 0, 2 ) === '//' ) { - // - Path is outside wgResourceBasePath, ignore. - // - Path is protocol-relative. Fixes T155310. Not supported by RelPath lib. + if ( strpos( $path, $remotePath ) !== 0 ) { + // Path is outside wgResourceBasePath, ignore. return $path; } $path = RelPath\getRelativePath( $path, $remotePath ); diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 0e83006..f0c8f7a 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -152,9 +152,6 @@ // Unrelated path with domain component. Ignored. [ 'baseDir' => $baseDir, 'basePath' => '/w', 'https://example.org/files/test.jpg' ], [ 'baseDir' => $baseDir, 'basePath' => '/w', '//example.org/files/test.jpg' ], - // Unrelated path with domain, and empty base path (root mw install). Ignored. - [ 'baseDir' => $baseDir, 'basePath' => '', 'https://example.org/files/test.jpg' ], - [ 'baseDir' => $baseDir, 'basePath' => '', '//example.org/files/test.jpg' ], // T155310 ]; } -- To view, visit https://gerrit.wikimedia.org/r/332972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa8b010b6c38d86ea048447f836d6ecde6b1e0ad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits