}
$badtag = false;
- if ( isset( $htmlelements[$t = strtolower( $t )] ) ) {
+ $t = strtolower( $t );
+ if ( isset( $htmlelements[$t] ) ) {
# Check our stack
if ( $slash && isset( $htmlsingleonly[$t] ) ) {
$badtag = true;
list( /* $qbar */, $slash, $t, $params, $brace, $rest ) = $regs;
$badtag = false;
- if ( isset( $htmlelements[$t = strtolower( $t )] ) ) {
+ $t = strtolower( $t );
+ if ( isset( $htmlelements[$t] ) ) {
if ( is_callable( $processCallback ) ) {
call_user_func_array( $processCallback, array( &$params, $args ) );
}
// Capture any PHP warnings from the output buffer and append them to the
// error list if we're in debug mode.
- if ( $context->getDebug() && strlen( $warnings = ob_get_contents() ) ) {
- $this->errors[] = $warnings;
+ if ( $context->getDebug() ) {
+ $warnings = ob_get_contents();
+ if ( strlen( $warnings ) ) {
+ $this->errors[] = $warnings;
+ }
}
// Save response to file cache unless there are errors
$response = $fileCache->fetchText();
// Capture any PHP warnings from the output buffer and append them to the
// response in a comment if we're in debug mode.
- if ( $context->getDebug() && strlen( $warnings = ob_get_contents() ) ) {
- $response = self::makeComment( $warnings ) . $response;
+ if ( $context->getDebug() ) {
+ $warnings = ob_get_contents();
+ if ( strlen( $warnings ) ) {
+ $response = self::makeComment( $warnings ) . $response;
+ }
}
// Remove the output buffer and output the response
ob_end_clean();
)->inContentLanguage() );
}
- if ( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
+ $ns = $request->getVal( 'namespace', null );
+ if ( $ns !== null && $ns !== '' ) {
$this->opts['namespace'] = intval( $ns );
} else {
$this->opts['namespace'] = '';
$target = $userObj->getName();
$out->addSubtitle( $this->getSubTitle( $userObj ) );
- if ( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
+ $ns = $request->getVal( 'namespace', null );
+ if ( $ns !== null && $ns !== '' ) {
$options['namespace'] = intval( $ns );
} else {
$options['namespace'] = '';
$m = array();
if ( preg_match( $prefixRegexp, $dbkey, $m ) ) {
$p = $m[1];
- if ( ( $ns = $this->language->getNsIndex( $p ) ) !== false ) {
+ $ns = $this->language->getNsIndex( $p );
+ if ( $ns !== false ) {
# Ordinary namespace
$dbkey = $m[2];
$parts['namespace'] = $ns;
}
}
// The absolute filename itself will differ from install to install so don't leave it out
- if ( ( $path = realpath( $file ) ) !== false ) {
+ $path = realpath( $file );
+ if ( $path !== false ) {
$state .= $path;
} else {
$state .= $file;
private function getNsIndex( $namespace ) {
global $wgContLang;
- if ( ( $result = $wgContLang->getNsIndex( $namespace ) ) !== false ) {
+ $result = $wgContLang->getNsIndex( $namespace );
+ if ( $result !== false ) {
return $result;
}
$ns = intval( $namespace );