Followup cf5f641: pass $params by reference again
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 14326ec..859b421 100644 (file)
@@ -1081,7 +1081,7 @@ function wfDebugMem( $exact = false ) {
  * @param string|bool $dest Destination of the message:
  *     - 'all': both to the log and HTML (debug toolbar or HTML comments)
  *     - 'log': only to the log and not in HTML
- *     - 'private': only to the specifc log if set in $wgDebugLogGroups and
+ *     - 'private': only to the specific log if set in $wgDebugLogGroups and
  *       discarded otherwise
  *   For backward compatibility, it can also take a boolean:
  *     - true: same as 'all'
@@ -1531,7 +1531,7 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform
 function wfMsgGetKey( $key, $useDB = true, $langCode = false, $transform = true ) {
        wfDeprecated( __METHOD__, '1.21' );
 
-       wfRunHooks( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) );
+       Hooks::run( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) );
 
        $cache = MessageCache::singleton();
        $message = $cache->get( $key, $useDB, $langCode );
@@ -1837,7 +1837,7 @@ function wfBacktrace( $raw = null ) {
 
        $frames = array_map( function ( $frame ) use ( $frameFormat ) {
                $file = !empty( $frame['file'] ) ? basename( $frame['file'] ) : '-';
-               $line = $frame['line'] ?: '-';
+               $line = isset( $frame['line'] ) ? $frame['line'] : '-';
                $call = $frame['function'];
                if ( !empty( $frame['class'] ) ) {
                        $call = $frame['class'] . $frame['type'] . $call;
@@ -2964,7 +2964,7 @@ function wfShellWikiCmd( $script, array $parameters = array(), array $options =
        global $wgPhpCli;
        // Give site config file a chance to run the script in a wrapper.
        // The caller may likely want to call wfBasename() on $script.
-       wfRunHooks( 'wfShellWikiCmd', array( &$script, &$parameters, &$options ) );
+       Hooks::run( 'wfShellWikiCmd', array( &$script, &$parameters, &$options ) );
        $cmd = isset( $options['php'] ) ? array( $options['php'] ) : array( $wgPhpCli );
        if ( isset( $options['wrapper'] ) ) {
                $cmd[] = $options['wrapper'];
@@ -3416,7 +3416,7 @@ function wfResetSessionID() {
                $_SESSION = $tmp;
        }
        $newSessionId = session_id();
-       wfRunHooks( 'ResetSessionID', array( $oldSessionId, $newSessionId ) );
+       Hooks::run( 'ResetSessionID', array( $oldSessionId, $newSessionId ) );
 }
 
 /**
@@ -3551,7 +3551,7 @@ function wfSplitWikiID( $wiki ) {
  *
  * @return DatabaseBase
  */
-function &wfGetDB( $db, $groups = array(), $wiki = false ) {
+function wfGetDB( $db, $groups = array(), $wiki = false ) {
        return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki );
 }
 
@@ -3570,7 +3570,7 @@ function wfGetLB( $wiki = false ) {
  *
  * @return LBFactory
  */
-function &wfGetLBFactory() {
+function wfGetLBFactory() {
        return LBFactory::singleton();
 }
 
@@ -3946,6 +3946,7 @@ function wfGetLangConverterCacheStorage() {
  * @param string|null $deprecatedVersion Optionally mark hook as deprecated with version number
  *
  * @return bool True if no handler aborted the hook
+ * @deprecated 1.25
  */
 function wfRunHooks( $event, array $args = array(), $deprecatedVersion = null ) {
        return Hooks::run( $event, $args, $deprecatedVersion );
@@ -4013,7 +4014,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
 
        # Run the extension hook
        $bad = false;
-       if ( !wfRunHooks( 'BadImage', array( $name, &$bad ) ) ) {
+       if ( !Hooks::run( 'BadImage', array( $name, &$bad ) ) ) {
                wfProfileOut( __METHOD__ );
                return $bad;
        }
@@ -4077,7 +4078,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
  */
 function wfCanIPUseHTTPS( $ip ) {
        $canDo = true;
-       wfRunHooks( 'CanIPUseHTTPS', array( $ip, &$canDo ) );
+       Hooks::run( 'CanIPUseHTTPS', array( $ip, &$canDo ) );
        return !!$canDo;
 }