Index: trunk/extensions/MobileFrontend/library/resources/wurfl-config.xml |
— | — | @@ -8,7 +8,11 @@ |
9 | 9 | </wurfl> |
10 | 10 | <allow-reload>true</allow-reload> |
11 | 11 | <persistence> |
| 12 | + <provider>file</provider> |
| 13 | + <params>/tmp</params> |
| 14 | +<!-- |
12 | 15 | <provider>mwmemcache</provider> |
13 | 16 | <params>serverip=127.0.0.1</params> |
| 17 | +--> |
14 | 18 | </persistence> |
15 | 19 | </wurfl-config> |
Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -57,6 +57,8 @@ |
58 | 58 | |
59 | 59 | public $contentFormat = ''; |
60 | 60 | public $WMLSectionSeperator = '***************************************************************************'; |
| 61 | + public static $title; |
| 62 | + public static $htmlTitle; |
61 | 63 | public static $dir; |
62 | 64 | public static $code; |
63 | 65 | public static $device; |
— | — | @@ -122,6 +124,10 @@ |
123 | 125 | public function onOutputPageBeforeHTML( &$out, &$text ) { |
124 | 126 | global $wgContLang, $wgRequest, $wgMemc, $wgUser; |
125 | 127 | |
| 128 | + // The title |
| 129 | + self::$title = $out->getTitle(); |
| 130 | + self::$htmlTitle = $out->getHTMLTitle(); |
| 131 | + |
126 | 132 | // Need to get copyright footer from skin. The footer changes depending |
127 | 133 | // on whether we're using the WikimediaMessages extension or not. |
128 | 134 | $skin=$wgUser->getSkin(); |
— | — | @@ -278,7 +284,7 @@ |
279 | 285 | $explainDisable = self::$messages['mobile-frontend-explain-disable']; |
280 | 286 | $disableButton = self::$messages['mobile-frontend-disable-button']; |
281 | 287 | $backButton = self::$messages['mobile-frontend-back-button']; |
282 | | - $title = $areYouSure; |
| 288 | + $htmlTitle = $areYouSure; |
283 | 289 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
284 | 290 | require( 'views/notices/_donate.html.php' ); |
285 | 291 | require( 'views/layout/_search_webkit.html.php' ); |
— | — | @@ -360,11 +366,12 @@ |
361 | 367 | return $s; |
362 | 368 | } |
363 | 369 | |
364 | | - private function createWMLCard( $s, $title = '' ) { |
| 370 | + private function createWMLCard( $s ) { |
365 | 371 | $segments = explode( $this->WMLSectionSeperator, $s ); |
366 | 372 | $card = ''; |
367 | 373 | $idx = 0; |
368 | 374 | $requestedSegment = self::$requestedSegment; |
| 375 | + $title = htmlspecialchars( self::$title->getText() ); |
369 | 376 | |
370 | 377 | $card .= "<card id='{$idx}' title='{$title}'><p>{$segments[$requestedSegment]}</p>"; |
371 | 378 | $idx = $requestedSegment + 1; |
— | — | @@ -415,12 +422,6 @@ |
416 | 423 | |
417 | 424 | $itemToRemoveRecords = $this->parseItemsToRemove(); |
418 | 425 | |
419 | | - $titleNode = $this->doc->getElementsByTagName( 'title' ); |
420 | | - |
421 | | - if ( $titleNode->length > 0 ) { |
422 | | - $title = $titleNode->item( 0 )->nodeValue; |
423 | | - } |
424 | | - |
425 | 426 | // Tags |
426 | 427 | |
427 | 428 | // You can't remove DOMNodes from a DOMNodeList as you're iterating |
— | — | @@ -516,6 +517,9 @@ |
517 | 518 | $homeButton = self::$messages['mobile-frontend-home-button']; |
518 | 519 | $randomButton = self::$messages['mobile-frontend-random-button']; |
519 | 520 | |
| 521 | + $title = htmlspecialchars( self::$title->getText() ); |
| 522 | + $htmlTitle = htmlspecialchars( self::$htmlTitle ); |
| 523 | + |
520 | 524 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
521 | 525 | |
522 | 526 | if ( strlen( $contentHtml ) > 4000 && $this->contentFormat == 'XHTML' |
— | — | @@ -538,7 +542,7 @@ |
539 | 543 | $contentHtml = $this->headingTransform( $contentHtml ); |
540 | 544 | |
541 | 545 | // Content wrapping |
542 | | - $contentHtml = $this->createWMLCard( $contentHtml, $title ); |
| 546 | + $contentHtml = $this->createWMLCard( $contentHtml ); |
543 | 547 | require( 'views/layout/application.wml.php' ); |
544 | 548 | } |
545 | 549 | |
— | — | @@ -552,7 +556,7 @@ |
553 | 557 | header( 'Content-Type: application/json' ); |
554 | 558 | header( 'Content-Disposition: attachment; filename="data.js";' ); |
555 | 559 | $json_data = array(); |
556 | | - $json_data['title'] = $title; |
| 560 | + $json_data['title'] = self::$title->getText(); |
557 | 561 | $json_data['html'] = $contentHtml; |
558 | 562 | |
559 | 563 | $json = json_encode( $json_data ); |
Index: trunk/extensions/MobileFrontend/views/layout/_footmenu_default.html.php |
— | — | @@ -4,9 +4,9 @@ |
5 | 5 | <div id='footer'> |
6 | 6 | <div class='nav' id='footmenu'> |
7 | 7 | <div class='mwm-notice'> |
8 | | - <a href="?mAction=view_normal_site">{$regularSite}</a> |
| 8 | + <a href="{$regularSiteUrl}">{$regularSite}</a> |
9 | 9 | <div id="perm"> |
10 | | - <a href="?mAction=disable_mobile_site">{$permStopRedirect}</a> |
| 10 | + <a href="{$permStopRedirectUrl}">{$permStopRedirect}</a> |
11 | 11 | </div> |
12 | 12 | </div> |
13 | 13 | </div> |
Index: trunk/extensions/MobileFrontend/views/layout/application.html.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
13 | 13 | <html lang='{$code}' dir='{$dir}' xml:lang='{$code}' xmlns='http://www.w3.org/1999/xhtml'> |
14 | 14 | <head> |
15 | | - <title>{$title}</title> |
| 15 | + <title>{$htmlTitle}</title> |
16 | 16 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
17 | 17 | <link href='{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/{$cssFileName}.css' media='all' rel='Stylesheet' type='text/css' /> |
18 | 18 | <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> |