From: Alexandre Emsenhuber Date: Thu, 16 Feb 2012 16:09:08 +0000 (+0000) Subject: Whitespaces fixes X-Git-Tag: 1.31.0-rc.0~24668 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=95a8a3564370130dd59c226a1db86b46be8480e7;p=lhc%2Fweb%2Fwiklou.git Whitespaces fixes --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 59c987159c..066864b604 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -37,7 +37,7 @@ class EditPage { const AS_HOOK_ERROR = 210; /** - * Status: The filter function set in $wgFilterCallback returned true (= block it) + * Status: The filter function set in $wgFilterCallback returned true (= block it) */ const AS_FILTERING = 211; @@ -182,7 +182,7 @@ class EditPage { * @var ParserOutput */ var $mParserOutput; - + /** * Has a summary been preset using GET parameter &summary= ? * @var Bool @@ -288,7 +288,7 @@ class EditPage { } wfProfileIn( __METHOD__ ); - wfDebug( __METHOD__.": enter\n" ); + wfDebug( __METHOD__ . ": enter\n" ); // If they used redlink=1 and the page exists, redirect to the main article if ( $wgRequest->getBool( 'redlink' ) && $this->mTitle->exists() ) { @@ -339,7 +339,7 @@ class EditPage { return; } - wfProfileIn( __METHOD__."-business-end" ); + wfProfileIn( __METHOD__ . "-business-end" ); $this->isConflict = false; // css / js subpages of user pages get a special treatment @@ -361,7 +361,7 @@ class EditPage { if ( 'save' == $this->formtype ) { if ( !$this->attemptSave() ) { - wfProfileOut( __METHOD__."-business-end" ); + wfProfileOut( __METHOD__ . "-business-end" ); wfProfileOut( __METHOD__ ); return; } @@ -372,7 +372,7 @@ class EditPage { if ( 'initial' == $this->formtype || $this->firsttime ) { if ( $this->initialiseForm() === false ) { $this->noSuchSectionPage(); - wfProfileOut( __METHOD__."-business-end" ); + wfProfileOut( __METHOD__ . "-business-end" ); wfProfileOut( __METHOD__ ); return; } @@ -383,7 +383,7 @@ class EditPage { } $this->showEditForm(); - wfProfileOut( __METHOD__."-business-end" ); + wfProfileOut( __METHOD__ . "-business-end" ); wfProfileOut( __METHOD__ ); } @@ -400,7 +400,7 @@ class EditPage { } # Ignore some permissions errors when a user is just previewing/viewing diffs $remove = array(); - foreach( $permErrors as $error ) { + foreach ( $permErrors as $error ) { if ( ( $this->preview || $this->diff ) && ( $error[0] == 'blockedtext' || $error[0] == 'autoblockedtext' ) ) { @@ -475,7 +475,7 @@ class EditPage { */ function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) { wfDeprecated( __METHOD__, '1.19' ); - + global $wgRequest, $wgOut; if ( $wgRequest->getBool( 'redlink' ) ) { // The edit page was reached via a red link. @@ -507,7 +507,7 @@ class EditPage { // Standard preference behaviour return true; } elseif ( !$this->mTitle->exists() && - isset($wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()]) && + isset( $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] ) && $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] ) { // Categories are special @@ -524,7 +524,7 @@ class EditPage { * @return bool */ protected function isWrongCaseCssJsPage() { - if( $this->mTitle->isCssJsSubpage() ) { + if ( $this->mTitle->isCssJsSubpage() ) { $name = $this->mTitle->getSkinFromCssJsSubpage(); $skins = array_merge( array_keys( Skin::getSkinNames() ), @@ -564,15 +564,15 @@ class EditPage { # Also remove trailing whitespace, but don't remove _initial_ # whitespace from the text boxes. This may be significant formatting. $this->textbox1 = $this->safeUnicodeInput( $request, 'wpTextbox1' ); - if ( !$request->getCheck('wpTextbox2') ) { + if ( !$request->getCheck( 'wpTextbox2' ) ) { // Skip this if wpTextbox2 has input, it indicates that we came // from a conflict page with raw page text, not a custom form // modified by subclasses - wfProfileIn( get_class($this)."::importContentFormData" ); + wfProfileIn( get_class( $this ) . "::importContentFormData" ); $textbox1 = $this->importContentFormData( $request ); - if ( isset($textbox1) ) + if ( isset( $textbox1 ) ) $this->textbox1 = $textbox1; - wfProfileOut( get_class($this)."::importContentFormData" ); + wfProfileOut( get_class( $this ) . "::importContentFormData" ); } # Truncate for whole multibyte characters. +5 bytes for ellipsis @@ -582,7 +582,7 @@ class EditPage { # header syntax, e.g. 'Foobar'. This is mainly an issue when we are using wpSummary for # section titles. $this->summary = preg_replace( '/^\s*=+\s*(.*?)\s*=+\s*$/', '$1', $this->summary ); - + # Treat sectiontitle the same way as summary. # Note that wpSectionTitle is not yet a part of the actual edit form, as wpSummary is # currently doing double duty as both edit summary and section title. Right now this @@ -656,7 +656,7 @@ class EditPage { { $this->allowBlankSummary = true; } else { - $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' ) || !$wgUser->getOption( 'forceeditsummary'); + $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' ) || !$wgUser->getOption( 'forceeditsummary' ); } $this->autoSumm = $request->getText( 'wpAutoSummary' ); @@ -675,7 +675,7 @@ class EditPage { $this->minoredit = false; $this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overriden by request parameters $this->recreate = false; - + // When creating a new section, we can preload a section title by passing it as the // preloadtitle parameter in the URL (Bug 13100) if ( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) { @@ -915,7 +915,7 @@ class EditPage { if ( !empty( $this->mPreloadText ) ) { return $this->mPreloadText; } - + if ( $preload === '' ) { return ''; } @@ -1229,10 +1229,10 @@ class EditPage { if ( $this->sectiontitle !== '' ) { // Insert the section title above the content. $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->sectiontitle ) . "\n\n" . $text; - + // Jump to the new section $result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->sectiontitle ); - + // If no edit summary was specified, create one automatically from the section // title and have it link to the new section. Otherwise, respect the summary as // passed. @@ -1243,7 +1243,7 @@ class EditPage { } elseif ( $this->summary !== '' ) { // Insert the section title above the content. $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $text; - + // Jump to the new section $result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->summary ); @@ -1276,7 +1276,7 @@ class EditPage { } else { // New comment; suppress conflict. $this->isConflict = false; - wfDebug( __METHOD__ .": conflict suppressed; new section\n" ); + wfDebug( __METHOD__ . ": conflict suppressed; new section\n" ); } } elseif ( $this->section == '' && $this->userWasLastToEdit( $wgUser->getId(), $this->edittime ) ) { # Suppress edit conflict with self, except for section edits where merging is required. @@ -1284,7 +1284,7 @@ class EditPage { $this->isConflict = false; } } - + // If sectiontitle is set, use it, otherwise use the summary as the section title (for // backwards compatibility with old forms/bots). if ( $this->sectiontitle !== '' ) { @@ -1292,7 +1292,7 @@ class EditPage { } else { $sectionTitle = $this->summary; } - + if ( $this->isConflict ) { wfDebug( __METHOD__ . ": conflict! getting section '$this->section' for time '$this->edittime' (article time '{$timestamp}')\n" ); $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $sectionTitle, $this->edittime ); @@ -1472,18 +1472,18 @@ class EditPage { * @return bool */ protected function userWasLastToEdit( $id, $edittime ) { - if( !$id ) return false; + if ( !$id ) return false; $dbw = wfGetDB( DB_MASTER ); $res = $dbw->select( 'revision', 'rev_user', array( 'rev_page' => $this->mTitle->getArticleId(), - 'rev_timestamp > '.$dbw->addQuotes( $dbw->timestamp($edittime) ) + 'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $edittime ) ) ), __METHOD__, array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 50 ) ); foreach ( $res as $row ) { - if( $row->rev_user != $id ) { + if ( $row->rev_user != $id ) { return false; } } @@ -1498,7 +1498,7 @@ class EditPage { * * @return bool */ - function mergeChangesInto( &$editText ){ + function mergeChangesInto( &$editText ) { wfProfileIn( __METHOD__ ); $db = wfGetDB( DB_MASTER ); @@ -1577,9 +1577,9 @@ class EditPage { * @return bool|string */ protected static function matchSpamRegexInternal( $text, $regexes ) { - foreach( $regexes as $regex ) { + foreach ( $regexes as $regex ) { $matches = array(); - if( preg_match( $regex, $text, $matches ) ) { + if ( preg_match( $regex, $text, $matches ) ) { return $matches[0]; } } @@ -1642,7 +1642,7 @@ class EditPage { $username = $parts[0]; $user = User::newFromName( $username, false /* allow IP users*/ ); $ip = User::isIP( $username ); - if ( !($user && $user->isLoggedIn()) && !$ip ) { # User does not exist + if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userpage-userdoesnotexist', wfEscapeWikiText( $username ) ) ); } elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked @@ -1676,7 +1676,7 @@ class EditPage { '', array( 'lim' => 10, 'conds' => array( "log_action != 'revision'" ), 'showIfEmpty' => false, - 'msgKey' => array( 'recreate-moveddeleted-warn') ) + 'msgKey' => array( 'recreate-moveddeleted-warn' ) ) ); } } @@ -1712,10 +1712,10 @@ class EditPage { wfProfileIn( __METHOD__ ); - #need to parse the preview early so that we know which templates are used, - #otherwise users with "show preview after edit box" will get a blank list - #we parse this near the beginning so that setHeaders can do the title - #setting work instead of leaving it in getPreviewText + # need to parse the preview early so that we know which templates are used, + # otherwise users with "show preview after edit box" will get a blank list + # we parse this near the beginning so that setHeaders can do the title + # setting work instead of leaving it in getPreviewText $previewOutput = ''; if ( $this->formtype == 'preview' ) { $previewOutput = $this->getPreviewText(); @@ -1797,9 +1797,9 @@ class EditPage { // If a summary has been preset using &summary= we dont want to prompt for // a different summary. Only prompt for a summary if the summary is blanked. // (Bug 17416) - $this->autoSumm = md5(''); + $this->autoSumm = md5( '' ); } - + $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); $wgOut->addHTML( Html::hidden( 'wpAutoSummary', $autosumm ) ); @@ -1874,7 +1874,7 @@ class EditPage { preg_match( "/^(=+)(.+)\\1(\n|$)/i", $text, $matches ); if ( !empty( $matches[2] ) ) { global $wgParser; - return $wgParser->stripSectionName(trim($matches[2])); + return $wgParser->stripSectionName( trim( $matches[2] ) ); } else { return false; } @@ -1888,7 +1888,7 @@ class EditPage { } # Optional notices on a per-namespace and per-page basis - $editnotice_ns = 'editnotice-'.$this->mTitle->getNamespace(); + $editnotice_ns = 'editnotice-' . $this->mTitle->getNamespace(); $editnotice_ns_message = wfMessage( $editnotice_ns )->inContentLanguage(); if ( $editnotice_ns_message->exists() ) { $wgOut->addWikiText( $editnotice_ns_message->plain() ); @@ -1897,10 +1897,10 @@ class EditPage { $parts = explode( '/', $this->mTitle->getDBkey() ); $editnotice_base = $editnotice_ns; while ( count( $parts ) > 0 ) { - $editnotice_base .= '-'.array_shift( $parts ); + $editnotice_base .= '-' . array_shift( $parts ); $editnotice_base_msg = wfMessage( $editnotice_base )->inContentLanguage(); if ( $editnotice_base_msg->exists() ) { - $wgOut->addWikiText( $editnotice_base_msg->plain() ); + $wgOut->addWikiText( $editnotice_base_msg->plain() ); } } } else { @@ -2014,12 +2014,12 @@ class EditPage { } if ( $this->mTitle->isCascadeProtected() ) { # Is this page under cascading protection from some source pages? - list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources(); + list( $cascadeSources, /* $restrictions */ ) = $this->mTitle->getCascadeProtectionSources(); $notice = "
\n$1\n"; $cascadeSourcesCount = count( $cascadeSources ); if ( $cascadeSourcesCount > 0 ) { # Explain, and list the titles responsible - foreach( $cascadeSources as $page ) { + foreach ( $cascadeSources as $page ) { $notice .= '* [[:' . $page->getPrefixedText() . "]]\n"; } } @@ -2028,7 +2028,7 @@ class EditPage { } if ( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) ) { LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle, '', - array( 'lim' => 1, + array( 'lim' => 1, 'showIfEmpty' => false, 'msgKey' => array( 'titleprotectedwarning' ), 'wrap' => "
\n$1
" ) ); @@ -2042,7 +2042,7 @@ class EditPage { $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) ) ); } else { - if( !wfMessage('longpage-hint')->isDisabled() ) { + if ( !wfMessage( 'longpage-hint' )->isDisabled() ) { $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'longpage-hint', $wgLang->formatSize( strlen( $this->textbox1 ) ), strlen( $this->textbox1 ) ) ); @@ -2064,9 +2064,9 @@ class EditPage { * * @return array An array in the format array( $label, $input ) */ - function getSummaryInput($summary = "", $labelText = null, $inputAttrs = null, $spanLabelAttrs = null) { - //Note: the maxlength is overriden in JS to 250 and to make it use UTF-8 bytes, not characters. - $inputAttrs = ( is_array($inputAttrs) ? $inputAttrs : array() ) + array( + function getSummaryInput( $summary = "", $labelText = null, $inputAttrs = null, $spanLabelAttrs = null ) { + // Note: the maxlength is overriden in JS to 250 and to make it use UTF-8 bytes, not characters. + $inputAttrs = ( is_array( $inputAttrs ) ? $inputAttrs : array() ) + array( 'id' => 'wpSummary', 'maxlength' => '200', 'tabindex' => '1', @@ -2074,7 +2074,7 @@ class EditPage { 'spellcheck' => 'true', ) + Linker::tooltipAndAccesskeyAttribs( 'summary' ); - $spanLabelAttrs = ( is_array($spanLabelAttrs) ? $spanLabelAttrs : array() ) + array( + $spanLabelAttrs = ( is_array( $spanLabelAttrs ) ? $spanLabelAttrs : array() ) + array( 'class' => $this->missingSummary ? 'mw-summarymissed' : 'mw-summary', 'id' => "wpSummaryLabel" ); @@ -2112,8 +2112,8 @@ class EditPage { } $summary = $wgContLang->recodeForEdit( $summary ); $labelText = wfMsgExt( $isSubjectPreview ? 'subject' : 'summary', 'parseinline' ); - list($label, $input) = $this->getSummaryInput($summary, $labelText, array( 'class' => $summaryClass ), array()); - $wgOut->addHTML("{$label} {$input}"); + list( $label, $input ) = $this->getSummaryInput( $summary, $labelText, array( 'class' => $summaryClass ), array() ); + $wgOut->addHTML( "{$label} {$input}" ); } /** @@ -2150,7 +2150,7 @@ class EditPage { HTML ); if ( !$this->checkUnicodeCompliantBrowser() ) - $wgOut->addHTML(Html::hidden( 'safemode', '1' )); + $wgOut->addHTML( Html::hidden( 'safemode', '1' ) ); } protected function showFormAfterText() { @@ -2234,7 +2234,7 @@ HTML global $wgOut, $wgUser; $wikitext = $this->safeUnicodeOutput( $content ); - if ( strval($wikitext) !== '' ) { + if ( strval( $wikitext ) !== '' ) { // Ensure there's a newline at the end, otherwise adding lines // is awkward. // But don't add a newline if the ext is empty, or Firefox in XHTML @@ -2276,7 +2276,7 @@ HTML $wgOut->addHTML( '
' ); - if ( $this->formtype == 'diff') { + if ( $this->formtype == 'diff' ) { $this->showDiff(); } } @@ -2289,12 +2289,12 @@ HTML */ protected function showPreview( $text ) { global $wgOut; - if ( $this->mTitle->getNamespace() == NS_CATEGORY) { + if ( $this->mTitle->getNamespace() == NS_CATEGORY ) { $this->mArticle->openShowCategory(); } # This hook seems slightly odd here, but makes things more # consistent for extensions. - wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$text ) ); + wfRunHooks( 'OutputPageBeforeHTML', array( &$wgOut, &$text ) ); $wgOut->addHTML( $text ); if ( $this->mTitle->getNamespace() == NS_CATEGORY ) { $this->mArticle->closeShowCategory(); @@ -2346,7 +2346,7 @@ HTML protected function showTosSummary() { $msg = 'editpage-tos-summary'; wfRunHooks( 'EditPageTosSummary', array( $this->mTitle, &$msg ) ); - if( !wfMessage( $msg )->isDisabled() ) { + if ( !wfMessage( $msg )->isDisabled() ) { global $wgOut; $wgOut->addHTML( '
' ); $wgOut->addWikiMsg( $msg ); @@ -2375,7 +2375,7 @@ HTML wfRunHooks( 'EditPageCopyrightWarning', array( $this->mTitle, &$copywarnMsg ) ); return "
\n" . - call_user_func_array("wfMsgNoTrans", $copywarnMsg) . "\n
"; + call_user_func_array( "wfMsgNoTrans", $copywarnMsg ) . "\n
"; } protected function showStandardInputs( &$tabindex = 2 ) { @@ -2398,8 +2398,8 @@ HTML $cancel .= wfMsgExt( 'pipe-separator' , 'escapenoentities' ); } $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ) ); - $edithelp = ''. - htmlspecialchars( wfMsg( 'edithelp' ) ).' '. + $edithelp = '' . + htmlspecialchars( wfMsg( 'edithelp' ) ) . ' ' . htmlspecialchars( wfMsg( 'newwindow' ) ); $wgOut->addHTML( " {$cancel}{$edithelp}\n" ); $wgOut->addHTML( "\n\n" ); @@ -2503,10 +2503,10 @@ HTML array( 'LIMIT' => 1, 'ORDER BY' => 'log_timestamp DESC' ) ); // Quick paranoid permission checks... - if( is_object( $data ) ) { - if( $data->log_deleted & LogPage::DELETED_USER ) + if ( is_object( $data ) ) { + if ( $data->log_deleted & LogPage::DELETED_USER ) $data->user_name = wfMsgHtml( 'rev-deleted-user' ); - if( $data->log_deleted & LogPage::DELETED_COMMENT ) + if ( $data->log_deleted & LogPage::DELETED_COMMENT ) $data->log_comment = wfMsgHtml( 'rev-deleted-comment' ); } return $data; @@ -2552,15 +2552,15 @@ HTML $parserOptions->setEditSection( false ); $parserOptions->setTidy( true ); $parserOptions->setIsPreview( true ); - $parserOptions->setIsSectionPreview( !is_null($this->section) && $this->section !== '' ); + $parserOptions->setIsSectionPreview( !is_null( $this->section ) && $this->section !== '' ); # don't parse non-wikitext pages, show message about preview # XXX: stupid php bug won't let us use $this->getContextTitle()->isCssJsSubpage() here -- This note has been there since r3530. Sure the bug was fixed time ago? if ( $this->isCssJsSubpage || !$this->mTitle->isWikitextPage() ) { - if( $this->mTitle->isCssJsSubpage() ) { + if ( $this->mTitle->isCssJsSubpage() ) { $level = 'user'; - } elseif( $this->mTitle->isCssOrJsPage() ) { + } elseif ( $this->mTitle->isCssOrJsPage() ) { $level = 'site'; } else { $level = false; @@ -2568,11 +2568,11 @@ HTML # Used messages to make sure grep find them: # Messages: usercsspreview, userjspreview, sitecsspreview, sitejspreview - if( $level ) { - if (preg_match( "/\\.css$/", $this->mTitle->getText() ) ) { + if ( $level ) { + if ( preg_match( "/\\.css$/", $this->mTitle->getText() ) ) { $previewtext = "
\n" . wfMsg( "{$level}csspreview" ) . "\n
"; $class = "mw-code mw-css"; - } elseif (preg_match( "/\\.js$/", $this->mTitle->getText() ) ) { + } elseif ( preg_match( "/\\.js$/", $this->mTitle->getText() ) ) { $previewtext = "
\n" . wfMsg( "{$level}jspreview" ) . "\n
"; $class = "mw-code mw-js"; } else { @@ -2614,7 +2614,7 @@ HTML } } - if( $this->isConflict ) { + if ( $this->isConflict ) { $conflict = '

' . htmlspecialchars( wfMsg( 'previewconflict' ) ) . "

\n"; } else { $conflict = '
'; @@ -2626,7 +2626,7 @@ HTML $pageLang = $this->mTitle->getPageLanguage(); $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), - 'class' => 'mw-content-'.$pageLang->getDir() ); + 'class' => 'mw-content-' . $pageLang->getDir() ); $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML ); wfProfileOut( __METHOD__ ); @@ -2642,9 +2642,9 @@ HTML if ( !isset( $this->mParserOutput ) ) { return $templates; } - foreach( $this->mParserOutput->getTemplates() as $ns => $template) { - foreach( array_keys( $template ) as $dbk ) { - $templates[] = Title::makeTitle($ns, $dbk); + foreach ( $this->mParserOutput->getTemplates() as $ns => $template ) { + foreach ( array_keys( $template ) as $dbk ) { + $templates[] = Title::makeTitle( $ns, $dbk ); } } return $templates; @@ -2743,7 +2743,7 @@ HTML 'tip' => wfMsg( 'media_tip' ), 'key' => 'M' ) : false, - $wgUseTeX ? array( + $wgUseTeX ? array( 'image' => $wgLang->getImageFile( 'button-math' ), 'id' => 'mw-editbutton-math', 'open' => "", @@ -2802,7 +2802,7 @@ HTML $script .= Xml::encodeJsCall( 'mw.toolbar.addButton', $params ); } - + // This used to be called on DOMReady from mediawiki.action.edit, which // ended up causing race conditions with the setup code above. $script .= "\n" . @@ -2888,9 +2888,9 @@ HTML 'tabindex' => ++$tabindex, 'value' => wfMsg( 'savearticle' ), 'accesskey' => wfMsg( 'accesskey-save' ), - 'title' => wfMsg( 'tooltip-save' ).' ['.wfMsg( 'accesskey-save' ).']', + 'title' => wfMsg( 'tooltip-save' ) . ' [' . wfMsg( 'accesskey-save' ) . ']', ); - $buttons['save'] = Xml::element('input', $temp, ''); + $buttons['save'] = Xml::element( 'input', $temp, '' ); ++$tabindex; // use the same for preview and live preview $temp = array( @@ -3008,7 +3008,7 @@ HTML */ static function spamPage( $match = false ) { wfDeprecated( __METHOD__, '1.17' ); - + global $wgOut, $wgTitle; $wgOut->prepareErrorPage( wfMessage( 'spamprotectiontitle' ) ); @@ -3078,7 +3078,7 @@ HTML } $currentbrowser = $_SERVER["HTTP_USER_AGENT"]; foreach ( $wgBrowserBlackList as $browser ) { - if ( preg_match($browser, $currentbrowser) ) { + if ( preg_match( $browser, $currentbrowser ) ) { return false; } } @@ -3149,25 +3149,25 @@ HTML $bytesleft = 0; $result = ""; $working = 0; - for( $i = 0; $i < strlen( $invalue ); $i++ ) { + for ( $i = 0; $i < strlen( $invalue ); $i++ ) { $bytevalue = ord( $invalue[$i] ); - if ( $bytevalue <= 0x7F ) { //0xxx xxxx + if ( $bytevalue <= 0x7F ) { // 0xxx xxxx $result .= chr( $bytevalue ); $bytesleft = 0; - } elseif ( $bytevalue <= 0xBF ) { //10xx xxxx + } elseif ( $bytevalue <= 0xBF ) { // 10xx xxxx $working = $working << 6; - $working += ($bytevalue & 0x3F); + $working += ( $bytevalue & 0x3F ); $bytesleft--; if ( $bytesleft <= 0 ) { $result .= "&#x" . strtoupper( dechex( $working ) ) . ";"; } - } elseif ( $bytevalue <= 0xDF ) { //110x xxxx + } elseif ( $bytevalue <= 0xDF ) { // 110x xxxx $working = $bytevalue & 0x1F; $bytesleft = 1; - } elseif ( $bytevalue <= 0xEF ) { //1110 xxxx + } elseif ( $bytevalue <= 0xEF ) { // 1110 xxxx $working = $bytevalue & 0x0F; $bytesleft = 2; - } else { //1111 0xxx + } else { // 1111 0xxx $working = $bytevalue & 0x07; $bytesleft = 3; } @@ -3186,20 +3186,20 @@ HTML */ function unmakesafe( $invalue ) { $result = ""; - for( $i = 0; $i < strlen( $invalue ); $i++ ) { - if ( ( substr( $invalue, $i, 3 ) == "&#x" ) && ( $invalue[$i+3] != '0' ) ) { + for ( $i = 0; $i < strlen( $invalue ); $i++ ) { + if ( ( substr( $invalue, $i, 3 ) == "&#x" ) && ( $invalue[$i + 3] != '0' ) ) { $i += 3; $hexstring = ""; do { $hexstring .= $invalue[$i]; $i++; - } while( ctype_xdigit( $invalue[$i] ) && ( $i < strlen( $invalue ) ) ); + } while ( ctype_xdigit( $invalue[$i] ) && ( $i < strlen( $invalue ) ) ); // Do some sanity checks. These aren't needed for reversability, // but should help keep the breakage down if the editor // breaks one of the entities whilst editing. - if ( (substr($invalue,$i,1)==";") and (strlen($hexstring) <= 6) ) { - $codepoint = hexdec($hexstring); + if ( ( substr( $invalue, $i, 1 ) == ";" ) and ( strlen( $hexstring ) <= 6 ) ) { + $codepoint = hexdec( $hexstring ); $result .= codepointToUtf8( $codepoint ); } else { $result .= "&#x" . $hexstring . substr( $invalue, $i, 1 );