Merge "wfRunHooks() return value no longer implies whether variable value was found"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 31 Dec 2013 09:16:41 +0000 (09:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 31 Dec 2013 09:16:41 +0000 (09:16 +0000)
1  2 
includes/parser/Parser.php

@@@ -2109,6 -2109,7 +2109,6 @@@ class Parser 
  
                                        /**
                                         * Strip the whitespace Category links produce, see bug 87
 -                                       * @todo We might want to use trim($tmp, "\n") here.
                                         */
                                        $s .= trim( $prefix . $trail, "\n" ) == '' ? '' : $prefix . $trail;
  
                                $value = ( wfUrlencode( $this->mTitle->getSubjectNsText() ) );
                                break;
                        case 'currentdayname':
 -                              $value = $pageLang->getWeekdayName( MWTimestamp::getInstance( $ts )->format( 'w' ) + 1 );
 +                              $value = $pageLang->getWeekdayName( (int)MWTimestamp::getInstance( $ts )->format( 'w' ) + 1 );
                                break;
                        case 'currentyear':
                                $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'Y' ), true );
                                $value = $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format( 'w' ) );
                                break;
                        case 'localdayname':
 -                              $value = $pageLang->getWeekdayName( MWTimestamp::getLocalInstance( $ts )->format( 'w' ) + 1 );
 +                              $value = $pageLang->getWeekdayName( (int)MWTimestamp::getLocalInstance( $ts )->format( 'w' ) + 1 );
                                break;
                        case 'localyear':
                                $value = $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format( 'Y' ), true );
                                return $wgLanguageCode;
                        default:
                                $ret = null;
-                               if ( wfRunHooks( 'ParserGetVariableValueSwitch', array( &$this, &$this->mVarCache, &$index, &$ret, &$frame ) ) ) {
-                                       return $ret;
-                               } else {
-                                       return null;
-                               }
+                               wfRunHooks( 'ParserGetVariableValueSwitch', array( &$this, &$this->mVarCache, &$index, &$ret, &$frame ) );
+                               return $ret;
                }
  
                if ( $index ) {