}
# Don't save a new article if it's blank.
- if ( ( '' == $this->textbox1 ) ) {
+ if ( '' == $this->textbox1 ) {
wfProfileOut( $fname );
return self::AS_BLANK_ARTICLE;
}
$this->didSave = true;
}
- switch ($value)
- {
+ switch ($value) {
case self::AS_HOOK_ERROR_EXPECTED:
case self::AS_CONTENT_TOO_BIG:
case self::AS_ARTICLE_WAS_DELETED:
case self::AS_MAX_ARTICLE_SIZE_EXCEDED:
case self::AS_END:
return true;
-
+
case self::AS_HOOK_ERROR:
case self::AS_FILTERING:
case self::AS_SUCCESS_NEW_ARTICLE:
$this->setRobotpolicy( 'noindex,nofollow' );
$this->setArticleRelated( false );
-
+
// If no reason is given, just supply a default "I can't let you do
// that, Dave" message. Should only occur if called by legacy code.
if ( $protected && empty($reasons) ) {
*/
public function getBaseText() {
global $wgNamespacesWithSubpages;
- if( isset( $wgNamespacesWithSubpages[ $this->mNamespace ] ) && $wgNamespacesWithSubpages[ $this->mNamespace ] ) {
+ if( !empty( $wgNamespacesWithSubpages[$this->mNamespace] ) ) {
$parts = explode( '/', $this->getText() );
# Don't discard the real title if there's no subpage involved
if( count( $parts ) > 1 )
} else {
$dbkey = wfUrlencode( $this->getPrefixedDBkey() );
if ( $query == '' ) {
- if($variant!=false && $wgContLang->hasVariants()){
- if($wgVariantArticlePath==false) {
+ if( $variant != false && $wgContLang->hasVariants() ) {
+ if( $wgVariantArticlePath == false ) {
$variantArticlePath = "$wgScript?title=$1&variant=$2"; // default
} else {
$variantArticlePath = $wgVariantArticlePath;
}
$url = str_replace( '$2', urlencode( $variant ), $variantArticlePath );
$url = str_replace( '$1', $dbkey, $url );
- }
- else {
+ } else {
$url = str_replace( '$1', $dbkey, $wgArticlePath );
}
} else {