Index: trunk/phase3/maintenance/checkSyntax.php |
— | — | @@ -105,7 +105,8 @@ |
106 | 106 | if ( !$f ) { |
107 | 107 | $this->error( "Can't open file $file\n", true ); |
108 | 108 | } |
109 | | - while ( $path = trim( fgets( $f ) ) ) { |
| 109 | + $path = trim( fgets( $f ) ); |
| 110 | + while ( $path ) { |
110 | 111 | $this->addPath( $path ); |
111 | 112 | } |
112 | 113 | fclose( $f ); |
— | — | @@ -113,6 +114,7 @@ |
114 | 115 | } elseif ( $this->hasOption( 'modified' ) ) { |
115 | 116 | $this->output( "Retrieving list from Subversion... " ); |
116 | 117 | $parentDir = wfEscapeShellArg( dirname( __FILE__ ) . '/..' ); |
| 118 | + $retval = null; |
117 | 119 | $output = wfShellExec( "svn status --ignore-externals $parentDir", $retval ); |
118 | 120 | if ( $retval ) { |
119 | 121 | $this->error( "Error retrieving list from Subversion!\n", true ); |
Index: trunk/phase3/maintenance/rebuildrecentchanges.php |
— | — | @@ -119,7 +119,8 @@ |
120 | 120 | "AND rev_timestamp<'{$emit}' ORDER BY rev_timestamp DESC"; |
121 | 121 | $sql2 = $dbw->limitResult( $sql2, 1, false ); |
122 | 122 | $res2 = $dbw->query( $sql2 ); |
123 | | - if ( $row = $dbw->fetchObject( $res2 ) ) { |
| 123 | + $row = $dbw->fetchObject( $res2 ); |
| 124 | + if ( $row ) { |
124 | 125 | $lastOldId = intval( $row->rev_id ); |
125 | 126 | # Grab the last text size if available |
126 | 127 | $lastSize = !is_null( $row->rev_len ) ? intval( $row->rev_len ) : 'NULL'; |
Index: trunk/phase3/maintenance/importImages.inc |
— | — | @@ -18,7 +18,8 @@ |
19 | 19 | */ |
20 | 20 | function findFiles( $dir, $exts ) { |
21 | 21 | if ( is_dir( $dir ) ) { |
22 | | - if ( $dhl = opendir( $dir ) ) { |
| 22 | + $dhl = opendir( $dir ); |
| 23 | + if ( $dhl ) { |
23 | 24 | $files = array(); |
24 | 25 | while ( ( $file = readdir( $dhl ) ) !== false ) { |
25 | 26 | if ( is_file( $dir . '/' . $file ) ) { |
Index: trunk/phase3/maintenance/findhooks.php |
— | — | @@ -145,7 +145,8 @@ |
146 | 146 | */ |
147 | 147 | private function getHooksFromPath( $path ) { |
148 | 148 | $hooks = array(); |
149 | | - if ( $dh = opendir( $path ) ) { |
| 149 | + $dh = opendir( $path ); |
| 150 | + if ( $dh ) { |
150 | 151 | while ( ( $file = readdir( $dh ) ) !== false ) { |
151 | 152 | if ( filetype( $path . $file ) == 'file' ) { |
152 | 153 | $hooks = array_merge( $hooks, $this->getHooksFromFile( $path . $file ) ); |
— | — | @@ -180,7 +181,8 @@ |
181 | 182 | */ |
182 | 183 | private function getBadHooksFromPath( $path ) { |
183 | 184 | $hooks = array(); |
184 | | - if ( $dh = opendir( $path ) ) { |
| 185 | + $dh = opendir( $path ); |
| 186 | + if ( $dh ) { |
185 | 187 | while ( ( $file = readdir( $dh ) ) !== false ) { |
186 | 188 | # We don't want to read this file as it contains bad calls to wfRunHooks() |
187 | 189 | if ( filetype( $path . $file ) == 'file' && !$path . $file == __FILE__ ) { |
Index: trunk/phase3/maintenance/namespaceDupes.php |
— | — | @@ -263,11 +263,12 @@ |
264 | 264 | $row->title .= $suffix; |
265 | 265 | $this->output( "... *** new title {$row->title}\n" ); |
266 | 266 | $title = Title::makeTitleSafe( $row->namespace, $row->title ); |
267 | | - if ( ! $title ) { |
| 267 | + if ( !$title ) { |
268 | 268 | $this->output( "... !!! invalid title\n" ); |
269 | 269 | return false; |
270 | 270 | } |
271 | | - if ( $id = $title->getArticleId() ) { |
| 271 | + $id = $title->getArticleId(); |
| 272 | + if ( $id ) { |
272 | 273 | $this->output( "... *** page exists with ID $id ***\n" ); |
273 | 274 | } else { |
274 | 275 | break; |
Index: trunk/phase3/skins/Standard.php |
— | — | @@ -186,7 +186,8 @@ |
187 | 187 | } |
188 | 188 | |
189 | 189 | $link = $this->mTitle->getText(); |
190 | | - if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary |
| 190 | + $nstext = $wgContLang->getNsText( $tns ); |
| 191 | + if( $nstext ) { # add namespace if necessary |
191 | 192 | $link = $nstext . ':' . $link; |
192 | 193 | } |
193 | 194 | |
Index: trunk/phase3/skins/Vector.php |
— | — | @@ -226,7 +226,8 @@ |
227 | 227 | $wgUser->isAllowed( 'deletedhistory' ) && |
228 | 228 | $wgUser->isAllowed( 'undelete' ) |
229 | 229 | ) { |
230 | | - if( $n = $this->mTitle->isDeleted() ) { |
| 230 | + $n = $this->mTitle->isDeleted(); |
| 231 | + if( $n ) { |
231 | 232 | $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); |
232 | 233 | $links['actions']['undelete'] = array( |
233 | 234 | 'class' => false, |
Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -308,8 +308,9 @@ |
309 | 309 | $x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks); |
310 | 310 | for ( ; $x < $x1; $x++) { |
311 | 311 | $line = $flip ? $this->yv[$x] : $this->xv[$x]; |
312 | | - if (empty($ymatches[$line])) |
313 | | - continue; |
| 312 | + if (empty($ymatches[$line])) { |
| 313 | + continue; |
| 314 | + } |
314 | 315 | $matches = $ymatches[$line]; |
315 | 316 | reset($matches); |
316 | 317 | while ( list( $junk, $y ) = each( $matches ) ) { |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -984,15 +984,18 @@ |
985 | 985 | wfDebug( __METHOD__ . ": showing CSS/JS source\n" ); |
986 | 986 | $this->showCssOrJsPage(); |
987 | 987 | $outputDone = true; |
988 | | - } else if ( $rt = Title::newFromRedirectArray( $text ) ) { |
989 | | - wfDebug( __METHOD__ . ": showing redirect=no page\n" ); |
990 | | - # Viewing a redirect page (e.g. with parameter redirect=no) |
991 | | - # Don't append the subtitle if this was an old revision |
992 | | - $wgOut->addHTML( $this->viewRedirect( $rt, !$wasRedirected && $this->isCurrent() ) ); |
993 | | - # Parse just to get categories, displaytitle, etc. |
994 | | - $this->mParserOutput = $wgParser->parse( $text, $this->mTitle, $parserOptions ); |
995 | | - $wgOut->addParserOutputNoText( $this->mParserOutput ); |
996 | | - $outputDone = true; |
| 988 | + } else { |
| 989 | + $rt = Title::newFromRedirectArray( $text ); |
| 990 | + if ( $rt ) { |
| 991 | + wfDebug( __METHOD__ . ": showing redirect=no page\n" ); |
| 992 | + # Viewing a redirect page (e.g. with parameter redirect=no) |
| 993 | + # Don't append the subtitle if this was an old revision |
| 994 | + $wgOut->addHTML( $this->viewRedirect( $rt, !$wasRedirected && $this->isCurrent() ) ); |
| 995 | + # Parse just to get categories, displaytitle, etc. |
| 996 | + $this->mParserOutput = $wgParser->parse( $text, $this->mTitle, $parserOptions ); |
| 997 | + $wgOut->addParserOutputNoText( $this->mParserOutput ); |
| 998 | + $outputDone = true; |
| 999 | + } |
997 | 1000 | } |
998 | 1001 | break; |
999 | 1002 | case 4: |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -780,7 +780,8 @@ |
781 | 781 | print( "Error in fieldInfo query: " . $this->getErrors() ); |
782 | 782 | return false; |
783 | 783 | } |
784 | | - if ( $meta = $this->fetchRow( $res ) ) { |
| 784 | + $meta = $this->fetchRow( $res ); |
| 785 | + if ( $meta ) { |
785 | 786 | return new MssqlField( $meta ); |
786 | 787 | } |
787 | 788 | return false; |
Index: trunk/phase3/includes/ChangeTags.php |
— | — | @@ -180,8 +180,8 @@ |
181 | 181 | // Caching... |
182 | 182 | global $wgMemc; |
183 | 183 | $key = wfMemcKey( 'valid-tags' ); |
184 | | - |
185 | | - if ( $tags = $wgMemc->get( $key ) ) { |
| 184 | + $tags = $wgMemc->get( $key ); |
| 185 | + if ( $tags ) { |
186 | 186 | return $tags; |
187 | 187 | } |
188 | 188 | |
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php |
— | — | @@ -201,7 +201,8 @@ |
202 | 202 | } |
203 | 203 | |
204 | 204 | $key = $this->getLocalCacheKey( 'ForeignAPIRepo', 'ThumbUrl', $name ); |
205 | | - if ( $thumbUrl = $wgMemc->get($key) ) { |
| 205 | + $thumbUrl = $wgMemc->get($key); |
| 206 | + if ( $thumbUrl ) { |
206 | 207 | wfDebug("Got thumb from local cache. $thumbUrl \n"); |
207 | 208 | return $thumbUrl; |
208 | 209 | } |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -906,7 +906,8 @@ |
907 | 907 | $retVal = array(); |
908 | 908 | if ( $db->numRows( $res ) ) { |
909 | 909 | foreach ( $res as $row ) { |
910 | | - if ( $titleObj = Title::newFromRow( $row ) ) { |
| 910 | + $titleObj = Title::newFromRow( $row ) |
| 911 | + if ( $titleObj ) { |
911 | 912 | $linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect, $row->page_latest ); |
912 | 913 | $retVal[] = $titleObj; |
913 | 914 | } |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1867,38 +1867,40 @@ |
1868 | 1868 | $parserOptions->setTidy( true ); |
1869 | 1869 | $parserOutput = $wgParser->parse( $previewtext, $this->mTitle, $parserOptions ); |
1870 | 1870 | $previewHTML = $parserOutput->mText; |
1871 | | - } elseif ( $rt = Title::newFromRedirectArray( $this->textbox1 ) ) { |
1872 | | - $previewHTML = $this->mArticle->viewRedirect( $rt, false ); |
1873 | 1871 | } else { |
1874 | | - $toparse = $this->textbox1; |
| 1872 | + $rt = Title::newFromRedirectArray( $this->textbox1 ); |
| 1873 | + if ( $rt ) { |
| 1874 | + $previewHTML = $this->mArticle->viewRedirect( $rt, false ); |
| 1875 | + } else { |
| 1876 | + $toparse = $this->textbox1; |
1875 | 1877 | |
1876 | | - # If we're adding a comment, we need to show the |
1877 | | - # summary as the headline |
1878 | | - if ( $this->section == "new" && $this->summary != "" ) { |
1879 | | - $toparse = "== {$this->summary} ==\n\n" . $toparse; |
1880 | | - } |
| 1878 | + # If we're adding a comment, we need to show the |
| 1879 | + # summary as the headline |
| 1880 | + if ( $this->section == "new" && $this->summary != "" ) { |
| 1881 | + $toparse = "== {$this->summary} ==\n\n" . $toparse; |
| 1882 | + } |
1881 | 1883 | |
1882 | | - wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) ); |
| 1884 | + wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) ); |
1883 | 1885 | |
1884 | | - // Parse mediawiki messages with correct target language |
1885 | | - if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
1886 | | - list( /* $unused */, $lang ) = $wgMessageCache->figureMessage( $this->mTitle->getText() ); |
1887 | | - $obj = wfGetLangObj( $lang ); |
1888 | | - $parserOptions->setTargetLanguage( $obj ); |
1889 | | - } |
| 1886 | + // Parse mediawiki messages with correct target language |
| 1887 | + if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
| 1888 | + list( /* $unused */, $lang ) = $wgMessageCache->figureMessage( $this->mTitle->getText() ); |
| 1889 | + $obj = wfGetLangObj( $lang ); |
| 1890 | + $parserOptions->setTargetLanguage( $obj ); |
| 1891 | + } |
1890 | 1892 | |
1891 | | - |
1892 | | - $parserOptions->setTidy( true ); |
1893 | | - $parserOptions->enableLimitReport(); |
1894 | | - $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ), |
| 1893 | + $parserOptions->setTidy( true ); |
| 1894 | + $parserOptions->enableLimitReport(); |
| 1895 | + $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ), |
1895 | 1896 | $this->mTitle, $parserOptions ); |
1896 | 1897 | |
1897 | | - $previewHTML = $parserOutput->getText(); |
1898 | | - $this->mParserOutput = $parserOutput; |
1899 | | - $wgOut->addParserOutputNoText( $parserOutput ); |
| 1898 | + $previewHTML = $parserOutput->getText(); |
| 1899 | + $this->mParserOutput = $parserOutput; |
| 1900 | + $wgOut->addParserOutputNoText( $parserOutput ); |
1900 | 1901 | |
1901 | | - if ( count( $parserOutput->getWarnings() ) ) { |
1902 | | - $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() ); |
| 1902 | + if ( count( $parserOutput->getWarnings() ) ) { |
| 1903 | + $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() ); |
| 1904 | + } |
1903 | 1905 | } |
1904 | 1906 | } |
1905 | 1907 | |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderWikiModule.php |
— | — | @@ -45,7 +45,8 @@ |
46 | 46 | if ( $ns === NS_MEDIAWIKI ) { |
47 | 47 | return wfEmptyMsg( $page ) ? '' : wfMsgExt( $page, 'content' ); |
48 | 48 | } |
49 | | - if ( $title = Title::newFromText( $page, $ns ) ) { |
| 49 | + $title = Title::newFromText( $page, $ns ); |
| 50 | + if ( $title ) { |
50 | 51 | if ( $title->isValidCssJsSubpage() && $revision = Revision::newFromTitle( $title ) ) { |
51 | 52 | return $revision->getRawText(); |
52 | 53 | } |
— | — | @@ -59,7 +60,8 @@ |
60 | 61 | $scripts = ''; |
61 | 62 | foreach ( $this->getPages( $context ) as $page => $options ) { |
62 | 63 | if ( $options['type'] === 'script' ) { |
63 | | - if ( $script = $this->getContent( $page, $options['ns'] ) ) { |
| 64 | + $script = $this->getContent( $page, $options['ns'] ); |
| 65 | + if ( $script ) { |
64 | 66 | $ns = MWNamespace::getCanonicalName( $options['ns'] ); |
65 | 67 | $scripts .= "/*$ns:$page */\n$script\n"; |
66 | 68 | } |
— | — | @@ -74,7 +76,8 @@ |
75 | 77 | foreach ( $this->getPages( $context ) as $page => $options ) { |
76 | 78 | if ( $options['type'] === 'style' ) { |
77 | 79 | $media = isset( $options['media'] ) ? $options['media'] : 'all'; |
78 | | - if ( $style = $this->getContent( $page, $options['ns'] ) ) { |
| 80 | + $style = $this->getContent( $page, $options['ns'] ); |
| 81 | + if ( $style ) { |
79 | 82 | if ( !isset( $styles[$media] ) ) { |
80 | 83 | $styles[$media] = ''; |
81 | 84 | } |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -108,8 +108,8 @@ |
109 | 109 | if( $wgRequest->getVal( 'printable' ) === 'yes' ) { |
110 | 110 | $wgOut->setPrintable(); |
111 | 111 | } |
112 | | - |
113 | | - if( $curid = $wgRequest->getInt( 'curid' ) ) { |
| 112 | + $curid = $wgRequest->getInt( 'curid' ); |
| 113 | + if( $curid ) { |
114 | 114 | // URLs like this are generated by RC, because rc_title isn't always accurate |
115 | 115 | $ret = Title::newFromID( $curid ); |
116 | 116 | } elseif( $title == '' && $action != 'delete' ) { |
— | — | @@ -191,7 +191,8 @@ |
192 | 192 | |
193 | 193 | // Interwiki redirects |
194 | 194 | } else if( $title->getInterwiki() != '' ) { |
195 | | - if( $rdfrom = $request->getVal( 'rdfrom' ) ) { |
| 195 | + $rdfrom = $request->getVal( 'rdfrom' ); |
| 196 | + if( $rdfrom ) { |
196 | 197 | $url = $title->getFullURL( 'rdfrom=' . urlencode( $rdfrom ) ); |
197 | 198 | } else { |
198 | 199 | $query = $request->getValues(); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2794,7 +2794,8 @@ |
2795 | 2795 | $retVal = array(); |
2796 | 2796 | if ( $db->numRows( $res ) ) { |
2797 | 2797 | foreach ( $res as $row ) { |
2798 | | - if ( $titleObj = Title::makeTitle( $row->page_namespace, $row->page_title ) ) { |
| 2798 | + $titleObj = Title::makeTitle( $row->page_namespace, $row->page_title ) |
| 2799 | + if ( $titleObj ) { |
2799 | 2800 | $linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect, $row->page_latest ); |
2800 | 2801 | $retVal[] = $titleObj; |
2801 | 2802 | } |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -793,7 +793,8 @@ |
794 | 794 | } else { |
795 | 795 | //article doesn't exist or is deleted |
796 | 796 | if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'deletedtext' ) ) { |
797 | | - if( $n = $this->mTitle->isDeleted() ) { |
| 797 | + $n = $this->mTitle->isDeleted(); |
| 798 | + if( $n ) { |
798 | 799 | $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); |
799 | 800 | $content_actions['undelete'] = array( |
800 | 801 | 'class' => false, |
Index: trunk/phase3/includes/specials/SpecialAllpages.php |
— | — | @@ -188,7 +188,8 @@ |
189 | 189 | array ('LIMIT' => 2, 'OFFSET' => $maxPerSubpage - 1, 'ORDER BY' => 'page_title ASC') |
190 | 190 | ); |
191 | 191 | |
192 | | - if( $s = $dbr->fetchObject( $res ) ) { |
| 192 | + $s = $dbr->fetchObject( $res ); |
| 193 | + if( $s ) { |
193 | 194 | array_push( $lines, $s->page_title ); |
194 | 195 | } else { |
195 | 196 | // Final chunk, but ended prematurely. Go back and find the end. |
— | — | @@ -198,7 +199,8 @@ |
199 | 200 | array_push( $lines, $endTitle ); |
200 | 201 | $done = true; |
201 | 202 | } |
202 | | - if( $s = $res->fetchObject() ) { |
| 203 | + $s = $res->fetchObject(); |
| 204 | + if( $s ) { |
203 | 205 | array_push( $lines, $s->page_title ); |
204 | 206 | $lastTitle = $s->page_title; |
205 | 207 | } else { |
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php |
— | — | @@ -99,7 +99,8 @@ |
100 | 100 | $query_options = array(); |
101 | 101 | |
102 | 102 | // left join with watchlist table to highlight watched rows |
103 | | - if( $uid = $wgUser->getId() ) { |
| 103 | + $uid = $wgUser->getId(); |
| 104 | + if( $uid ) { |
104 | 105 | $tables[] = 'watchlist'; |
105 | 106 | $select[] = 'wl_user'; |
106 | 107 | $join_conds['watchlist'] = array( 'LEFT JOIN', "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace" ); |
Index: trunk/phase3/includes/specials/SpecialExport.php |
— | — | @@ -229,8 +229,8 @@ |
230 | 230 | if( $this->templates ) { |
231 | 231 | $pageSet = $this->getTemplates( $inputPages, $pageSet ); |
232 | 232 | } |
233 | | - |
234 | | - if( $linkDepth = $this->pageLinkDepth ) { |
| 233 | + $linkDepth = $this->pageLinkDepth; |
| 234 | + if( $linkDepth ) { |
235 | 235 | $pageSet = $this->getPageLinks( $inputPages, $pageSet, $linkDepth ); |
236 | 236 | } |
237 | 237 | |
Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -293,7 +293,10 @@ |
294 | 294 | $out .= '<tr><td colspan="4">' . $this->listToText( $wgExtensionFunctions ) . "</td></tr>\n"; |
295 | 295 | } |
296 | 296 | |
297 | | - if ( $cnt = count( $tags = $wgParser->getTags() ) ) { |
| 297 | + $tags = $wgParser->getTags(); |
| 298 | + $cnt = count( $tags ); |
| 299 | + |
| 300 | + if ( $cnt ) { |
298 | 301 | for ( $i = 0; $i < $cnt; ++$i ) { |
299 | 302 | $tags[$i] = "<{$tags[$i]}>"; |
300 | 303 | } |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -74,8 +74,8 @@ |
75 | 75 | |
76 | 76 | # Hardcode this for now. |
77 | 77 | $limit = 48; |
78 | | - |
79 | | - if ( $parval = intval( $par ) ) { |
| 78 | + $parval = intval( $par ); |
| 79 | + if ( $parval ) { |
80 | 80 | if ( $parval <= $limit && $parval > 0 ) { |
81 | 81 | $limit = $parval; |
82 | 82 | } |
— | — | @@ -92,10 +92,12 @@ |
93 | 93 | } |
94 | 94 | |
95 | 95 | $invertSort = false; |
96 | | - if( $until = $wgRequest->getVal( 'until' ) ) { |
| 96 | + $until = $wgRequest->getVal( 'until' ); |
| 97 | + if( $until ) { |
97 | 98 | $where[] = "img_timestamp < '" . $dbr->timestamp( $until ) . "'"; |
98 | 99 | } |
99 | | - if( $from = $wgRequest->getVal( 'from' ) ) { |
| 100 | + $from = $wgRequest->getVal( 'from' ); |
| 101 | + if( $from ) { |
100 | 102 | $where[] = "img_timestamp >= '" . $dbr->timestamp( $from ) . "'"; |
101 | 103 | $invertSort = true; |
102 | 104 | } |
Index: trunk/phase3/includes/Metadata.php |
— | — | @@ -119,11 +119,14 @@ |
120 | 120 | protected function person($name, User $user ){ |
121 | 121 | if( $user->isAnon() ){ |
122 | 122 | $this->element( $name, wfMsgExt( 'anonymous', array( 'parsemag' ), 1 ) ); |
123 | | - } else if( $real = $user->getRealName() ) { |
124 | | - $this->element( $name, $real ); |
125 | 123 | } else { |
126 | | - $userName = $user->getName(); |
127 | | - $this->pageOrString( $name, $user->getUserPage(), wfMsgExt( 'siteuser', 'parsemag', $userName, $userName ) ); |
| 124 | + $real = $user->getRealName(); |
| 125 | + if( $real ) { |
| 126 | + $this->element( $name, $real ); |
| 127 | + } else { |
| 128 | + $userName = $user->getName(); |
| 129 | + $this->pageOrString( $name, $user->getUserPage(), wfMsgExt( 'siteuser', 'parsemag', $userName, $userName ) ); |
| 130 | + } |
128 | 131 | } |
129 | 132 | } |
130 | 133 | |
Index: trunk/phase3/includes/Exception.php |
— | — | @@ -179,7 +179,8 @@ |
180 | 180 | $wgOut->redirect( '' ); |
181 | 181 | $wgOut->clearHTML(); |
182 | 182 | |
183 | | - if ( $hookResult = $this->runHooks( get_class( $this ) ) ) { |
| 183 | + $hookResult = $this->runHooks( get_class( $this ) ); |
| 184 | + if ( $hookResult ) { |
184 | 185 | $wgOut->addHTML( $hookResult ); |
185 | 186 | } else { |
186 | 187 | $wgOut->addHTML( $this->getHTML() ); |
— | — | @@ -187,7 +188,8 @@ |
188 | 189 | |
189 | 190 | $wgOut->output(); |
190 | 191 | } else { |
191 | | - if ( $hookResult = $this->runHooks( get_class( $this ) . "Raw" ) ) { |
| 192 | + $hookResult = $this->runHooks( get_class( $this ) . "Raw" ); |
| 193 | + if ( $hookResult ) { |
192 | 194 | die( $hookResult ); |
193 | 195 | } |
194 | 196 | |
Index: trunk/phase3/includes/normal/UtfNormal.php |
— | — | @@ -308,7 +308,8 @@ |
309 | 309 | $len = $chunk + 1; # Counting down is faster. I'm *so* sorry. |
310 | 310 | |
311 | 311 | for( $i = -1; --$len; ) { |
312 | | - if( $remaining = $tailBytes[$c = $str{++$i}] ) { |
| 312 | + $remaining = $tailBytes[$c = $str{++$i}] |
| 313 | + if( $remaining ) { |
313 | 314 | # UTF-8 head byte! |
314 | 315 | $sequence = $head = $c; |
315 | 316 | do { |