# Make date header if necessary
$date = $wgLang->date( $rc_timestamp, true, true );
if( $date != $this->lastdate ) {
- if( '' != $this->lastdate ) {
+ if( $this->lastdate != '' ) {
$s .= "</ul>\n";
}
$s .= Xml::element( 'h4', null, $date ) . "\n<ul class=\"special\">";
}
# Don't save a new article if it's blank.
- if ( '' == $this->textbox1 ) {
+ if ( $this->textbox1 == '' ) {
wfProfileOut( __METHOD__ );
return self::AS_BLANK_ARTICLE;
}
if( $row->page_is_redirect ) {
$out .= ' ' . Xml::element( 'redirect', array() ) . "\n";
}
- if( '' != $row->page_restrictions ) {
+ if( $row->page_restrictions != '' ) {
$out .= ' ' . Xml::element( 'restrictions', array(),
strval( $row->page_restrictions ) ) . "\n";
}
array_map( array( $wgOut, 'debug' ), $cache );
$cache = array();
}
- if ( '' != $wgDebugLogFile && !$wgProfileOnly ) {
+ if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
# Strip unprintables; they can switch terminal modes when binary data
# gets dumped, which is pretty annoying.
$text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', $text );
$log = sprintf( "%s\t%04.3f\t%s\n",
gmdate( 'YmdHis' ), $elapsed,
urldecode( $wgRequest->getRequestURL() . $forward ) );
- if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) {
+ if ( $wgDebugLogFile != '' && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) {
wfErrorLog( $log . $prof, $wgDebugLogFile );
}
}
if ( !is_null( $wgReadOnly ) ) {
return (bool)$wgReadOnly;
}
- if ( '' == $wgReadOnlyFile ) {
+ if ( $wgReadOnlyFile == '' ) {
return false;
}
// Set $wgReadOnly for faster access next time
$cgi = '';
foreach ( $array1 as $key => $value ) {
- if ( '' !== $value ) {
- if ( '' != $cgi ) {
+ if ( $value != '' ) {
+ if ( $cgi != '' ) {
$cgi .= '&';
}
if ( is_array( $value ) ) {
* despite $query not being used.
*/
function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
- if ( '' == $text ) {
+ if ( $text == '' ) {
$text = htmlspecialchars( $nt->getPrefixedText() );
}
list( $inside, $trail ) = Linker::splitTrail( $trail );
* via Parser::maybeMakeExternalImage().
*/
function makeExternalImage( $url, $alt = '' ) {
- if ( '' == $alt ) {
+ if ( $alt == '' ) {
$alt = $this->fnamePart( $url );
}
$img = '';
$s = $thumb->toHtml( $params );
}
- if ( '' != $fp['align'] ) {
+ if ( $fp['align'] != '' ) {
$s = "<div class=\"float{$fp['align']}\">{$s}</div>";
}
return str_replace("\n", ' ',$prefix.$s.$postfix);
function specialLink( $name, $key = '' ) {
global $wgContLang;
- if ( '' == $key ) { $key = strtolower( $name ); }
+ if ( $key == '' ) { $key = strtolower( $name ); }
$pn = $wgContLang->ucfirst( $name );
return $this->makeKnownLink( $wgContLang->specialPage( $pn ),
wfMsg( $key ) );
}
# Handle link renaming [[foo|text]] will show link as "text"
- if( "" != $match[3] ) {
+ if( $match[3] != "" ) {
$text = $match[3];
} else {
$text = $match[1];
}
$ret = $contextTitle->getPrefixedText(). '/' . trim($noslash) . $suffix;
- if( '' === $text ) {
+ if( $text === '' ) {
$text = $target . $suffix;
} # this might be changed for ugliness reasons
} else {
# / at the end means don't show full path
if( substr( $nodotdot, -1, 1 ) === '/' ) {
$nodotdot = substr( $nodotdot, 0, -1 );
- if( '' === $text ) {
+ if( $text === '' ) {
$text = $nodotdot . $suffix;
}
}
$regex = $wgContLang->linkTrail();
}
$inside = '';
- if ( '' != $trail ) {
+ if ( $trail != '' ) {
$m = array();
if ( preg_match( $regex, $trail, $m ) ) {
$inside = $m[1];
*/
public function getRcComment() {
$rcComment = $this->actionText;
- if( '' != $this->comment ) {
+ if( $this->comment != '' ) {
if ($rcComment == '')
$rcComment = $this->comment;
else
return;
}
wfProfileIn( __METHOD__ );
- if ( '' != $this->mRedirect ) {
+ if ( $this->mRedirect != '' ) {
# Standards require redirect URLs to be absolute
$this->mRedirect = wfExpandUrl( $this->mRedirect );
if( $this->mRedirectCode == '301' || $this->mRedirectCode == '303' ) {
$returntoquery = $wgRequest->getText( 'returntoquery' );
}
- if ( '' === $returnto ) {
+ if ( $returnto === '' ) {
$returnto = Title::newMainPage();
}
$ret .= "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n";
}
- if ( '' == $this->getHTMLTitle() ) {
+ if ( $this->getHTMLTitle() == '' ) {
$this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ));
}
list( $cascadeSources, /* $restrictions */ ) = $this->mTitle->getCascadeProtectionSources();
- if ( "" != $err ) {
+ if ( $err != "" ) {
$wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
$wgOut->addHTML( "<p class='error'>{$err}</p>\n" );
}
global $wgOut;
$sub = $wgOut->getSubtitle();
- if ( '' == $sub ) {
+ if ( $sub == '' ) {
global $wgExtraSubtitle;
$sub = wfMsgExt( 'tagline', 'parsemag' ) . $wgExtraSubtitle;
}
}
function logoText( $align = '' ) {
- if ( '' != $align ) {
+ if ( $align != '' ) {
$a = " align='{$align}'";
} else {
$a = '';
$url = $nt->escapeFullURL();
$text = $wgContLang->getLanguageName( $nt->getInterwiki() );
- if ( '' == $text ) { $text = $l; }
+ if ( $text == '' ) { $text = $l; }
$style = $this->getExternalLinkAttributes();
$s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
}
$urlArgs = 'action=edit§ion=new';
$preloadMsg = wfMsgForContent( 'talk-addsection-preload' );
$editintroMsg = wfMsgForContent( 'talk-addsection-editintro' );
- if( '' != $preloadMsg ) {
+ if( $preloadMsg != '' ) {
$urlArgs .= '&preload=' . urlencode( $preloadMsg );
}
- if( '' != $editintroMsg ) {
+ if( $editintroMsg != '' ) {
$urlArgs .= '&editintro=' . urlencode( $editintroMsg );
}
$content_actions['addsection'] = array(
public function getNsText() {
global $wgContLang;
- if ( '' != $this->mInterwiki ) {
+ if ( $this->mInterwiki != '' ) {
// This probably shouldn't even happen. ohh man, oh yuck.
// But for interwiki transclusion it sometimes does.
// Shit. Shit shit shit.
*/
public function getFullText() {
$text = $this->getPrefixedText();
- if( '' != $this->mFragment ) {
+ if( $this->mFragment != '' ) {
$text .= '#' . $this->mFragment;
}
return $text;
$baseUrl = $interwiki->getURL( );
$namespace = wfUrlencode( $this->getNsText() );
- if ( '' != $namespace ) {
+ if ( $namespace != '' ) {
# Can this actually happen? Interwikis shouldn't be parsed.
# Yes! It can in interwiki transclusion. But... it probably shouldn't.
$namespace .= ':';
* interwiki link
*/
public function getEditURL() {
- if ( '' != $this->mInterwiki ) { return ''; }
+ if ( $this->mInterwiki != '' ) { return ''; }
$s = $this->getLocalURL( 'action=edit' );
return $s;
* Is this Title interwiki?
* @return \type{\bool}
*/
- public function isExternal() { return ( '' != $this->mInterwiki ); }
+ public function isExternal() { return ( $this->mInterwiki != '' ); }
/**
* Is this page "semi-protected" - the *only* protection is autoconfirm?
if( $right == 'sysop' ) {
$right = 'protect';
}
- if( '' != $right && !$user->isAllowed( $right ) ) {
+ if( $right != '' && !$user->isAllowed( $right ) ) {
// Users with 'editprotected' permission can edit protected pages
if( $action=='edit' && $user->isAllowed( 'editprotected' ) ) {
// Users with 'editprotected' permission cannot edit protected pages
if( $cascadingSources > 0 && isset($restrictions[$action]) ) {
foreach( $restrictions[$action] as $right ) {
$right = ( $right == 'sysop' ) ? 'protect' : $right;
- if( '' != $right && !$user->isAllowed( $right ) ) {
+ if( $right != '' && !$user->isAllowed( $right ) ) {
$pages = '';
foreach( $cascadingSources as $page )
$pages .= '* [[:' . $page->getPrefixedText() . "]]\n";
*/
/* private */ function prefix( $name ) {
$p = '';
- if ( '' != $this->mInterwiki ) {
+ if ( $this->mInterwiki != '' ) {
$p = $this->mInterwiki . ':';
}
if ( 0 != $this->mNamespace ) {
$dbkey = preg_replace( '/[ _\xA0\x{1680}\x{180E}\x{2000}-\x{200A}\x{2028}\x{2029}\x{202F}\x{205F}\x{3000}]+/u', '_', $dbkey );
$dbkey = trim( $dbkey, '_' );
- if ( '' == $dbkey ) {
+ if ( $dbkey == '' ) {
return false;
}
# We already know that some pages won't be in the database!
#
- if ( '' != $this->mInterwiki || NS_SPECIAL == $this->mNamespace ) {
+ if ( $this->mInterwiki != '' || NS_SPECIAL == $this->mNamespace ) {
$this->mArticleID = 0;
}
$fragment = strstr( $dbkey, '#' );
if ( strlen( $nt->getDBkey() ) < 1 ) {
$errors[] = array('articleexists');
}
- if ( ( '' == $this->getDBkey() ) ||
+ if ( ( $this->getDBkey() == '' ) ||
( !$oldid ) ||
- ( '' == $nt->getDBkey() ) ) {
+ ( $nt->getDBkey() == '' ) ) {
$errors[] = array('badarticleerror');
}
if( $curid = $wgRequest->getInt( 'curid' ) ) {
# URLs like this are generated by RC, because rc_title isn't always accurate
$ret = Title::newFromID( $curid );
- } elseif( '' == $title && 'delete' != $action ) {
+ } elseif( $title == '' && 'delete' != $action ) {
$ret = Title::newMainPage();
} else {
$ret = Title::newFromURL( $title );
}
}
- if ( '' != $cmd ) { $cmd .= ' '; }
+ if ( $cmd != '' ) { $cmd .= ' '; }
$cmd .= "$line\n";
if ( $done ) {
}
}
- if ( '' != $cmd ) {
+ if ( $cmd != '' ) {
$cmd .= ' ';
}
$cmd .= "$line\n";
$taglist = implode( '|', $elements );
$start = "/<($taglist)(\\s+[^>]*?|\\s*?)(\/?" . ">)|<(!--)/i";
- while ( '' != $text ) {
+ while ( $text != '' ) {
$p = preg_split( $start, $text, 2, PREG_SPLIT_DELIM_CAPTURE );
$stripped .= $p[0];
if( count( $p ) < 5 ) {
wfProfileOut( __METHOD__."-might_be_img" );
}
- $wasblank = ( '' == $text );
+ $wasblank = ( $text == '' );
if ( $wasblank ) $text = $link;
# Link not escaped by : , create the various objects
*/
/* private */ function closeParagraph() {
$result = '';
- if ( '' != $this->mLastSection ) {
+ if ( $this->mLastSection != '' ) {
$result = '</' . $this->mLastSection . ">\n";
}
$this->mInPre = false;
$t = substr( $t, 1 );
} else {
// paragraph
- if ( '' == trim($t) ) {
+ if ( trim($t) == '' ) {
if ( $paragraphStack ) {
$output .= $paragraphStack.'<br />';
$paragraphStack = false;
$output .= $this->closeList( $prefix2[$prefixLength-1] );
--$prefixLength;
}
- if ( '' != $this->mLastSection ) {
+ if ( $this->mLastSection != '' ) {
$output .= '</' . $this->mLastSection . '>';
$this->mLastSection = '';
}
$m = array();
if ( preg_match( "/^($nc+:|)$tc+?( \\($tc+\\))$/", $t, $m ) ) {
$text = preg_replace( $p2, "[[$m[1]\\1$m[2]|\\1]]", $text );
- } elseif ( preg_match( "/^($nc+:|)$tc+?(, $tc+|)$/", $t, $m ) && '' != "$m[1]$m[2]" ) {
+ } elseif ( preg_match( "/^($nc+:|)$tc+?(, $tc+|)$/", $t, $m ) && "$m[1]$m[2]" != '' ) {
$text = preg_replace( $p2, "[[$m[1]\\1$m[2]|\\1]]", $text );
} else {
# if there's no context, don't bother duplicating the title
}
static function validateEmailTarget ( $target ) {
- if ( "" == $target ) {
+ if ( $target == "" ) {
wfDebug( "Target is empty.\n" );
return "notarget";
}
$titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
$action = $titleObj->getLocalURL( "action=submit" );
- if ( "" != $err ) {
+ if ( $err != "" ) {
$wgOut->setSubtitle( wfMsg( "formerror" ) );
$wgOut->addWikiText( Xml::tags( 'span', array( 'class' => 'error' ), $err ) . "\n" );
}
global $wgOut, $wgUser;
$wgOut->setPagetitle( wfMsg( "ipblocklist" ) );
- if ( "" != $msg ) {
+ if ( $msg != "" ) {
$wgOut->setSubtitle( $msg );
}
$wgOut->setPagetitle( wfMsg( 'lockdb' ) );
$wgOut->addWikiMsg( 'lockdbtext' );
- if ( "" != $err ) {
+ if ( $err != "" ) {
$wgOut->setSubtitle( wfMsg( 'formerror' ) );
$wgOut->addHTML( '<p class="error">' . htmlspecialchars( $err ) . "</p>\n" );
}
public function showList( $msg = '' ) {
global $wgOut, $wgRequest;
- if( "" != $msg ) {
+ if( $msg != "" ) {
$wgOut->setSubtitle( $msg );
}
function showList( $msg = '' ) {
global $wgOut, $wgRequest;
- if ( "" != $msg ) {
+ if ( $msg != "" ) {
$wgOut->setSubtitle( $msg );
}
}
$filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':';
- if( '' === trim( $term ) || $filePrefix === trim( $term ) ) {
+ if( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
$wgOut->addHTML( $this->searchFocus() );
$wgOut->addHTML( $this->formHeader($term, 0, 0));
if( $this->searchAdvanced ) {
$wgOut->setPagetitle( wfMsg( "unlockdb" ) );
$wgOut->addWikiMsg( "unlockdbtext" );
- if ( "" != $err ) {
+ if ( $err != "" ) {
$wgOut->setSubtitle( wfMsg( "formerror" ) );
$wgOut->addHTML( '<p class="error">' . htmlspecialchars( $err ) . "</p>\n" );
}
function addNewAccountMailPassword() {
global $wgOut;
- if ('' == $this->mEmail) {
+ if ( $this->mEmail == '' ) {
$this->mainLoginForm( wfMsg( 'noemail', htmlspecialchars( $this->mName ) ) );
return;
}
// cation server before they create an account (otherwise, they can
// create a local account and login as any domain user). We only need
// to check this for domains that aren't local.
- if( 'local' != $this->mDomain && '' != $this->mDomain ) {
+ if( 'local' != $this->mDomain && $this->mDomain != '' ) {
if( !$wgAuth->canCreateAccounts() && ( !$wgAuth->userExists( $this->mName ) || !$wgAuth->authenticate( $this->mName, $this->mPassword ) ) ) {
$this->mainLoginForm( wfMsg( 'wrongpassword' ) );
return false;
*/
public function authenticateUserData() {
global $wgUser, $wgAuth;
- if ( '' == $this->mName ) {
+ if ( $this->mName == '' ) {
return self::NO_NAME;
}
// faces etc will probably just fail cleanly here.
$retval = self::RESET_PASS;
} else {
- $retval = '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
+ $retval = ($this->mPassword == '') ? self::EMPTY_PASS : self::WRONG_PASS;
}
} else {
$wgAuth->updateUser( $u );
return;
}
- if ( '' == $this->mName ) {
+ if ( $this->mName == '' ) {
$this->mainLoginForm( wfMsg( 'noname' ) );
return;
}
function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry;
- if ( '' == $u->getEmail() ) {
+ if ( $u->getEmail() == '' ) {
return new WikiError( wfMsg( 'noemail', $u->getName() ) );
}
$ip = wfGetIP();
}
}
- if ( '' == $this->mName ) {
+ if ( $this->mName == '' ) {
if ( $wgUser->isLoggedIn() ) {
$this->mName = $wgUser->getName();
} else {
}
if ( $wgUser->isAllowed( 'delete' ) ) {
$dtp = $this->deleteThisPage();
- if ( '' != $dtp ) {
+ if ( $dtp != '' ) {
$s .= $sep . $dtp;
}
}
if ( $wgUser->isAllowed( 'protect' ) ) {
$ptp = $this->protectThisPage();
- if ( '' != $ptp ) {
+ if ( $ptp != '' ) {
$s .= $sep . $ptp;
}
}
$search = $wgRequest->getText( 'search' );
$action = $this->escapeSearchLink();
$s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
- if( '' != $label ) {
+ if( $label != '' ) {
$s .= "{$label}: ";
}