r94267 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94266‎ | r94267 | r94268 >
Date:18:48, 11 August 2011
Author:preilly
Status:ok
Tags:
Comment:
fix for Bug 30153 - allow editing with default non-mobile view and also remove commented out code that was refactored
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -49,7 +49,7 @@
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
5252 class ExtMobileFrontend {
53 - const VERSION = '0.5.17';
 53+ const VERSION = '0.5.18';
5454
5555 /**
5656 * @var DOMDocument
@@ -173,34 +173,6 @@
174174 self::$title = $out->getTitle();
175175 self::$htmlTitle = $out->getHTMLTitle();
176176
177 - // Need to get copyright footer from skin. The footer changes depending
178 - // on whether we're using the WikimediaMessages extension or not.
179 - //$skin = $wgUser->getSkin();
180 - //$copyright = $skin->getCopyright();
181 -
182 - // Need to stash the results of the "wfMsg" call before the Output Buffering handler
183 - // because at this point the database connection is shut down, etc.
184 - //self::$messages['mobile-frontend-show'] = wfMsg( 'mobile-frontend-show-button' );
185 - //self::$messages['mobile-frontend-hide'] = wfMsg( 'mobile-frontend-hide-button' );
186 - //self::$messages['mobile-frontend-back-to-top'] = wfMsg( 'mobile-frontend-back-to-top-of-section' );
187 - //self::$messages['mobile-frontend-regular-site'] = wfMsg( 'mobile-frontend-regular-site' );
188 - //self::$messages['mobile-frontend-perm-stop-redirect'] = wfMsg( 'mobile-frontend-perm-stop-redirect' );
189 - //self::$messages['mobile-frontend-copyright'] = $copyright;
190 - //self::$messages['mobile-frontend-home-button'] = wfMsg( 'mobile-frontend-home-button' );
191 - //self::$messages['mobile-frontend-random-button'] = wfMsg( 'mobile-frontend-random-button' );
192 - //self::$messages['mobile-frontend-are-you-sure'] = wfMsg( 'mobile-frontend-are-you-sure' );
193 - //self::$messages['mobile-frontend-explain-disable'] = wfMsg( 'mobile-frontend-explain-disable' );
194 - //self::$messages['mobile-frontend-disable-button'] = wfMsg( 'mobile-frontend-disable-button' );
195 - //self::$messages['mobile-frontend-back-button'] = wfMsg( 'mobile-frontend-back-button' );
196 -
197 - //self::$dir = $wgContLang->getDir();
198 - //self::$code = $wgContLang->getCode();
199 -
200 - self::$disableImages = $wgRequest->getText( 'disableImages', 0 );
201 -
202 - //self::$mainPageUrl = Title::newMainPage()->getLocalUrl();
203 - //self::$randomPageUrl = SpecialPage::getTitleFor( 'Randompage' )->getLocalUrl();
204 -
205177 $userAgent = $_SERVER['HTTP_USER_AGENT'];
206178 $uAmd5 = md5($userAgent);
207179
@@ -234,6 +206,8 @@
235207 // This is stated to be intended behavior, as per the following: [http://bugs.php.net/bug.php?id=40104]
236208
237209 $mAction = $wgRequest->getText( 'mAction' );
 210+ $action = $wgRequest->getText( 'action' );
 211+ self::$disableImages = $wgRequest->getText( 'disableImages', 0 );
238212 self::$useFormat = $wgRequest->getText( 'useFormat' );
239213 self::$format = $wgRequest->getText( 'format' );
240214 self::$requestedSegment = $wgRequest->getText( 'seg', 0 );
@@ -325,9 +299,11 @@
326300 if (self::$useFormat === 'mobile' ||
327301 self::$useFormat === 'mobile-wap' ||
328302 !empty( $xDevice ) ) {
329 - $this->getMsg();
330 - $this->disableCaching();
331 - ob_start( array( $this, 'DOMParse' ) );
 303+ if ( $action !== 'edit' ) {
 304+ $this->getMsg();
 305+ $this->disableCaching();
 306+ ob_start( array( $this, 'DOMParse' ) );
 307+ }
332308 }
333309
334310 return true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94266fix for Bug 30153 - Editing fails awfully (regression from Ruby frontend) als...preilly18:45, 11 August 2011

Status & tagging log