case self::AS_SUCCESS_NEW_ARTICLE:
$query = $resultDetails['redirect'] ? 'redirect=no' : '';
if ( $extraQueryRedirect ) {
- if ( $query === '' ) {
- $query = $extraQueryRedirect;
- } else {
- $query .= '&' . $extraQueryRedirect;
+ if ( $query !== '' ) {
+ $query .= '&';
}
+ $query .= $extraQueryRedirect;
}
$anchor = $resultDetails['sectionanchor'] ?? '';
$out->redirect( $this->mTitle->getFullURL( $query ) . $anchor );
);
if ( $resultDetails['redirect'] ) {
- if ( $extraQuery == '' ) {
- $extraQuery = 'redirect=no';
- } else {
- $extraQuery = 'redirect=no&' . $extraQuery;
+ if ( $extraQuery !== '' ) {
+ $extraQuery = '&' . $extraQuery;
}
+ $extraQuery = 'redirect=no' . $extraQuery;
}
if ( $extraQueryRedirect ) {
- if ( $extraQuery === '' ) {
- $extraQuery = $extraQueryRedirect;
- } else {
- $extraQuery .= '&' . $extraQueryRedirect;
+ if ( $extraQuery !== '' ) {
+ $extraQuery .= '&';
}
+ $extraQuery .= $extraQueryRedirect;
}
$out->redirect( $this->mTitle->getFullURL( $extraQuery ) . $sectionanchor );
// count-alias subselect fields to avoid abigious definition errors
$i = 0;
foreach ( $varMap as &$val ) {
- $val .= ' field' . ( $i++ );
+ $val .= ' field' . $i;
+ $i++;
}
$selectSql = $this->selectSQLText(
* @return null|string
*/
function getThumbPath( $suffix = '' ) {
- if ( $this->repo->canCacheThumbs() ) {
- $path = $this->repo->getZonePath( 'thumb' ) . '/' . $this->getHashPath();
- if ( $suffix ) {
- $path .= $suffix . '/';
- }
-
- return $path;
- } else {
+ if ( !$this->repo->canCacheThumbs() ) {
return null;
}
+
+ $path = $this->repo->getZonePath( 'thumb' ) . '/' . $this->getHashPath();
+ if ( $suffix ) {
+ $path .= $suffix . '/';
+ }
+ return $path;
}
/**
public function makeKeyInternal( $keyspace, $args ) {
$key = $keyspace;
foreach ( $args as $arg ) {
- $arg = str_replace( ':', '%3A', $arg );
- $key .= ':' . $arg;
+ $key .= ':' . str_replace( ':', '%3A', $arg );
}
return strtr( $key, ' ', '_' );
}
$txt = preg_replace_callback( $reg, [ $this, 'pageTextCallback' ], $txt );
$txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";
$xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml, 1 ) .
- $txt . '</mw-djvu>';
+ $txt .
+ '</mw-djvu>';
}
}
$length -= $ellipsisLength;
$string = $getSubstring( $string, 0, $length ); // xyz...
$string = $this->removeBadCharLast( $string );
- $string = rtrim( $string );
- $string = $string . $ellipsis;
+ $string = rtrim( $string ) . $ellipsis;
} else {
$length += $ellipsisLength;
$string = $getSubstring( $string, $length ); // ...xyz
$string = $this->removeBadCharFirst( $string );
- $string = ltrim( $string );
- $string = $ellipsis . $string;
+ $string = $ellipsis . ltrim( $string );
}
}