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

Change subject: Replace usage of deprecated Title::escapeLocalURL()
......................................................................


Replace usage of deprecated Title::escapeLocalURL()

Change-Id: Id3e6ab27e6e7d0937d4364b7c98713bd7edaedbf
---
M specials/SpecialCheckUser.php
M specials/SpecialCheckUserLog.php
2 files changed, 25 insertions(+), 9 deletions(-)

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



diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 05a1c8f..a5a692c 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -116,6 +116,7 @@
         */
        protected function showForm( $user, $reason, $checktype, $ip, $xff, 
$name, $period ) {
                $action = $this->getPageTitle()->escapeLocalUrl();
+               $action = htmlspecialchars( 
$this->getPageTitle()->getLocalUrl() );
                # Fill in requested type if it makes sense
                $encipusers = $encedits = $encuserips = 0;
                if ( $checktype == 'subipusers' && ( $ip || $xff ) ) {
@@ -448,9 +449,12 @@
                        foreach ( $ips_edits as $ip => $edits ) {
                                $s .= '<li>';
                                $s .= '<a href="' .
-                                       $this->getPageTitle()->escapeLocalURL( 
'user=' . urlencode( $ip ) . '&reason=' . urlencode( $reason ) ) . '">' .
+                                       htmlspecialchars( 
$this->getPageTitle()->getLocalURL( array(
+                                               'user' => $ip,
+                                               'reason' => $reason
+                                       ) ) ) . '">' .
                                        htmlspecialchars( $ip ) . '</a>';
-                               $s .= ' (<a href="' . $blockip->escapeLocalURL( 
'ip=' . urlencode( $ip ) ) . '">' .
+                               $s .= ' (<a href="' . htmlspecialchars( 
$blockip->getLocalURL( 'ip=' . urlencode( $ip ) ) ) . '">' .
                                        $this->msg( 'blocklink' )->escaped() . 
'</a>)';
                                if ( $ips_first[$ip] == $ips_last[$ip] ) {
                                        $s .= ' (' . 
$this->getLanguage()->timeanddate( wfTimestamp( TS_MW, $ips_first[$ip] ), true 
) . ') ';
@@ -609,7 +613,11 @@
                                        $ip = long2ip( wfBaseConvert( 
$row->cuc_ip_hex, 16, 10, 8 ) );
                                }
                                $s .= '<li><a href="' .
-                                       $this->getPageTitle()->escapeLocalURL( 
'user=' . urlencode( $ip ) . '&reason=' . urlencode( $reason ) . 
'&checktype=subipusers' ) .
+                                       htmlspecialchars( 
$this->getPageTitle()->getLocalURL( array(
+                                               'user' => $ip,
+                                               'reason=' => $reason,
+                                               'checktype' => 'subipusers'
+                                       ) ) ) .
                                        '">' . $ip . '</a>';
                                if ( $row->first == $row->last ) {
                                        $s .= ' (' . 
$this->getLanguage()->timeanddate( wfTimestamp( TS_MW, $row->first ), true ) . 
') ';
@@ -901,7 +909,11 @@
                                        $ip = long2ip( wfBaseConvert( 
$row->cuc_ip_hex, 16, 10, 8 ) );
                                }
                                $s .= '<li><a href="' .
-                                       $this->getPageTitle()->escapeLocalURL( 
'user=' . urlencode( $ip ) . '&reason=' . urlencode( $reason ) . 
'&checktype=subipusers' ) .
+                                       htmlspecialchars( 
$this->getPageTitle()->getLocalURL( array(
+                                               'user' => $ip,
+                                               'reason' => $reason,
+                                               'checktype' => 'subipusers'
+                                       ) ) ) .
                                        '">' . $ip . '</a>';
                                if ( $row->first == $row->last ) {
                                        $s .= ' (' . 
$this->getLanguage()->timeanddate( wfTimestamp( TS_MW, $row->first ), true ) . 
') ';
@@ -971,7 +983,7 @@
                                }
                        }
 
-                       $action = $this->getPageTitle()->escapeLocalURL( 
'action=block' );
+                       $action = htmlspecialchars( 
$this->getPageTitle()->getLocalURL( 'action=block' ) );
                        $s = "<form name='checkuserblock' id='checkuserblock' 
action=\"$action\" method='post'>";
                        $s .= '<div id="checkuserresults"><ul>';
                        foreach ( $users_edits as $name => $count ) {
@@ -982,8 +994,10 @@
                                # Add user tool links
                                $s .= Linker::userLink( - 1 , $name ) . 
Linker::userToolLinks( - 1 , $name );
                                # Add CheckUser link
-                               $s .= ' (<a href="' . 
$this->getPageTitle()->escapeLocalURL( 'user=' . urlencode( $name ) .
-                                       '&reason=' . urlencode( $reason ) ) . 
'">' . $this->msg( 'checkuser-check' )->escaped() . '</a>)';
+                               $s .= ' (<a href="' . htmlspecialchars( 
$this->getPageTitle()->getLocalURL( array(
+                                               'user' => $name,
+                                               'reason=' => $reason
+                                       ) ) ) . '">' . $this->msg( 
'checkuser-check' )->escaped() . '</a>)';
                                # Show edit time range
                                if ( $users_first[$name] == $users_last[$name] 
) {
                                        // @todo FIXME: Hard coded parentheses.
@@ -1038,7 +1052,9 @@
                                        $set = $users_infosets[$name][$i];
                                        # IP link
                                        $s .= '<li>';
-                                       $s .= '<a href="' . 
$this->getPageTitle()->escapeLocalURL( 'user=' . urlencode( $set[0] ) ) . '">' 
. htmlspecialchars( $set[0] ) . '</a>';
+                                       $s .= '<a href="' .
+                                               htmlspecialchars( 
$this->getPageTitle()->getLocalURL( 'user=' . urlencode( $set[0] ) ) ) .
+                                               '">' . htmlspecialchars( 
$set[0] ) . '</a>';
                                        # XFF string, link to /xff search
                                        if ( $set[1] ) {
                                                # Flag our trusted proxies
diff --git a/specials/SpecialCheckUserLog.php b/specials/SpecialCheckUserLog.php
index 457b529..ef85ab5 100644
--- a/specials/SpecialCheckUserLog.php
+++ b/specials/SpecialCheckUserLog.php
@@ -99,7 +99,7 @@
                $msgSearch = $this->msg( 'checkuser-search' )->escaped();
                $input = "<input type=\"text\" name=\"cuSearch\" 
value=\"$encTarget\" size=\"40\"/>";
                $msgSearchForm = $this->msg( 'checkuser-search-form' 
)->rawParams( $select, $input )->escaped();
-               $formAction = $this->getPageTitle()->escapeLocalURL();
+               $formAction = htmlspecialchars( 
$this->getPageTitle()->getLocalURL() );
                $msgSearchSubmit = '&#160;&#160;' . $this->msg( 
'checkuser-search-submit' )->escaped() . '&#160;&#160;';
 
                $s = "<form method='get' action=\"$formAction\">\n" .

-- 
To view, visit https://gerrit.wikimedia.org/r/104362
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id3e6ab27e6e7d0937d4364b7c98713bd7edaedbf
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to