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

Change subject: Send W0 interstitial "No" clicks to mobile URL. Fixes bug 55578.
......................................................................


Send W0 interstitial "No" clicks to mobile URL. Fixes bug 55578.

Change-Id: I40ac696a45d17a222c3905d8f10627d8e16abaf5
---
M includes/PageRenderingHooks.php
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index 76bd6ea..f333c49 100644
--- a/includes/PageRenderingHooks.php
+++ b/includes/PageRenderingHooks.php
@@ -504,7 +504,7 @@
                        array( 'href' => $redir['to'] ),
                        wfMessage( 
'zero-rated-mobile-access-banner-text-data-charges-yes' )->escaped() );
                $reject = Html::rawElement( 'a',
-                       array( 'href' => $redir['from']->getFullURL() ),
+                       array( 'href' => $redir['from'] ),
                        wfMessage( 
'zero-rated-mobile-access-banner-text-data-charges-no' )->escaped() );
                $question = wfMessage( 
'zero-rated-mobile-access-banner-text-data-charges' )
                        ->rawParams( $accept, $reject )->escaped();
@@ -715,7 +715,7 @@
         * Returns empty array if no redirection,
         * array( 'redirect' => $url, 'code' => '302' ) to auto-redirect
         * array( 'softredirect' => $url ) in case there is no valid config 
(X-CS)
-        * array( 'warn' => 'external' or 'file', 'from' => $fromTitle, 'to' => 
$toUrl ) to show warning
+        * array( 'warn' => 'external' or 'file', 'from' => $fromUrl, 'to' => 
$toUrl ) to show warning
         */
        public function getRedirectInfo() {
                if ( $this->redirectInfo === null ) {
@@ -769,6 +769,7 @@
                        self::logDebug( '!config' );
                        return array( 'softredirect' => $toUrl );
                }
+               $fromUrl = MobileContext::singleton()->getMobileUrl( 
$fromTitle->getFullURL() );
                $redir = false;
                $urlBits = wfParseUrl( $toUrl );
                $toHost = is_array( $urlBits ) && array_key_exists( 'host', 
$urlBits ) ? $urlBits['host'] : false;
@@ -806,7 +807,7 @@
                }
                return array(
                        'warn' => ( $toHost ? 'external' : 'file' ),
-                       'from' => $fromTitle, 'to' => $toUrl );
+                       'from' => $fromUrl, 'to' => $toUrl );
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40ac696a45d17a222c3905d8f10627d8e16abaf5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt <ab...@wikimedia.org>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to