MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/97541
Change subject: Fix fatal due to access to protected field
......................................................................
Fix fatal due to access to protected field
Bug: 57549
Change-Id: I902f0795b2fa9b5d4af66ffb1975bd95c9eeb9a5
---
M handlers/TextHandler/TextHandler.php
1 file changed, 6 insertions(+), 20 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler
refs/changes/41/97541/1
diff --git a/handlers/TextHandler/TextHandler.php
b/handlers/TextHandler/TextHandler.php
index 405bb09..da171c7 100644
--- a/handlers/TextHandler/TextHandler.php
+++ b/handlers/TextHandler/TextHandler.php
@@ -267,26 +267,12 @@
*/
function getRepoPageURL( $pageTitle ){
$repo = $this->file->repo;
- $encName = wfUrlencode( $pageTitle );
- if ( !is_null( $repo->scriptDirUrl ) ) {
- # "http://example.com/w"
- #
- # We use "Image:" as the canonical namespace for
- # compatibility across all MediaWiki versions,
- # and just sort of hope index.php is right. ;)
- return $repo->makeUrl( "title=$encName" );
+
+ $url = $repo->getDescriptionUrl( $pageTitle );
+ if ( $url === false ) {
+ return false;
}
- if ( !is_null( $repo->descBaseUrl ) ) {
- # "http://example.com/wiki/Image:"
- return str_replace( array('Image:', 'File:' ), '',
$repo->descBaseUrl ) . $encName;
- }
- if ( !is_null( $repo->articleUrl ) ) {
- # "http://example.com/wiki/$1"
- #
- # We use "Image:" as the canonical namespace for
- # compatibility across all MediaWiki versions.
- return str_replace( '$1', "$encName", $this->articleUrl
);
- }
- return false;
+ $url = str_replace( array('Image:', 'File:' ), '', $url );
+ return $url;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/97541
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I902f0795b2fa9b5d4af66ffb1975bd95c9eeb9a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits