(bug 32434) API allows reblocking the user without reblock parameter.
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 982e965..d0a2042 100644 (file)
@@ -1037,7 +1037,7 @@ function wfDebugLog( $logGroup, $text, $public = true ) {
                        wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] );
                }
        } elseif ( $public === true ) {
-               wfDebug( $text, true );
+               wfDebug( "[$logGroup] $text", true );
        }
 }
 
@@ -1427,6 +1427,8 @@ function wfMessageFallback( /*...*/ ) {
  * @return String
  */
 function wfMsg( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReal( $key, $args );
@@ -1441,6 +1443,8 @@ function wfMsg( $key ) {
  * @return String
  */
 function wfMsgNoTrans( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReal( $key, $args, true, false, false );
@@ -1472,6 +1476,8 @@ function wfMsgNoTrans( $key ) {
  * @return String
  */
 function wfMsgForContent( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        global $wgForceUIMsgAsContentMsg;
        $args = func_get_args();
        array_shift( $args );
@@ -1493,6 +1499,8 @@ function wfMsgForContent( $key ) {
  * @return String
  */
 function wfMsgForContentNoTrans( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        global $wgForceUIMsgAsContentMsg;
        $args = func_get_args();
        array_shift( $args );
@@ -1518,6 +1526,8 @@ function wfMsgForContentNoTrans( $key ) {
  * @return String: the requested message.
  */
 function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform = true ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        wfProfileIn( __METHOD__ );
        $message = wfMsgGetKey( $key, $useDB, $forContent, $transform );
        $message = wfMsgReplaceArgs( $message, $args );
@@ -1538,6 +1548,8 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform
  * @return string
  */
 function wfMsgGetKey( $key, $useDB = true, $langCode = false, $transform = true ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        wfRunHooks( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) );
 
        $cache = MessageCache::singleton();
@@ -1592,6 +1604,8 @@ function wfMsgReplaceArgs( $message, $args ) {
  * @return string
  */
 function wfMsgHtml( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $key ) ), $args );
@@ -1611,6 +1625,8 @@ function wfMsgHtml( $key ) {
  * @return string
  */
 function wfMsgWikiHtml( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReplaceArgs(
@@ -1642,6 +1658,8 @@ function wfMsgWikiHtml( $key ) {
  * @return String
  */
 function wfMsgExt( $key, $options ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        array_shift( $args );
@@ -1722,6 +1740,8 @@ function wfMsgExt( $key, $options ) {
  * @return Boolean True if the message *doesn't* exist.
  */
 function wfEmptyMsg( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        return MessageCache::singleton()->get( $key, /*useDB*/true, /*content*/false ) === false;
 }
 
@@ -2340,7 +2360,7 @@ function wfSuppressWarnings( $end = false ) {
                }
        } else {
                if ( !$suppressCount ) {
-                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED ) );
+                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT ) );
                }
                ++$suppressCount;
        }
@@ -3269,6 +3289,18 @@ function wfHttpOnlySafe() {
        return true;
 }
 
+/**
+ * Check if there is sufficent entropy in php's built-in session generation
+ * @return bool true = there is sufficient entropy
+ */
+function wfCheckEntropy() {
+       return (
+                       ( wfIsWindows() && version_compare( PHP_VERSION, '5.3.3', '>=' ) )
+                       || ini_get( 'session.entropy_file' )
+               )
+               && intval( ini_get( 'session.entropy_length' ) ) >= 32;
+}
+
 /**
  * Override session_id before session startup if php's built-in
  * session generation code is not secure.
@@ -3283,11 +3315,7 @@ function wfFixSessionID() {
        // - entropy_file is set or you're on Windows with php 5.3.3+
        // - AND entropy_length is > 0
        // We treat it as disabled if it doesn't have an entropy length of at least 32
-       $entropyEnabled = (
-                       ( wfIsWindows() && version_compare( PHP_VERSION, '5.3.3', '>=' ) )
-                       || ini_get( 'session.entropy_file' )
-               )
-               && intval( ini_get( 'session.entropy_length' ) ) >= 32;
+       $entropyEnabled = wfCheckEntropy();
 
        // If built-in entropy is not enabled or not sufficient override php's built in session id generation code
        if ( !$entropyEnabled ) {