jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I902f0795b2fa9b5d4af66ffb1975bd95c9eeb9a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to