Moved view count from WikiPage to Title; avoids an extra DB query when showing the...
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 02c6c94..3223a55 100644 (file)
@@ -830,7 +830,7 @@ function wfDebug( $text, $logonly = false ) {
                if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
                        # Strip unprintables; they can switch terminal modes when binary data
                        # gets dumped, which is pretty annoying.
-                       $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1a\x1c-\x1f]!', ' ', $text );
+                       $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', $text );
                        $text = $wgDebugLogPrefix . $text;
                        wfErrorLog( $text, $wgDebugLogFile );
                }
@@ -3210,8 +3210,10 @@ function wfGetPrecompiledData( $name ) {
  * @return String
  */
 function wfMemcKey( /*... */ ) {
+       global $wgCachePrefix;
+       $prefix = $wgCachePrefix === false ? wfWikiID() : $wgCachePrefix;
        $args = func_get_args();
-       $key = wfWikiID() . ':' . implode( ':', $args );
+       $key = $prefix . ':' . implode( ':', $args );
        $key = str_replace( ' ', '_', $key );
        return $key;
 }
@@ -3241,10 +3243,8 @@ function wfForeignMemcKey( $db, $prefix /*, ... */ ) {
  * @return String
  */
 function wfWikiID() {
-       global $wgDBprefix, $wgDBname, $wgWikiID;
-       if ( $wgWikiID !== false ) {
-               return $wgWikiID;
-       } elseif ( $wgDBprefix ) {
+       global $wgDBprefix, $wgDBname;
+       if ( $wgDBprefix ) {
                return "$wgDBname-$wgDBprefix";
        } else {
                return $wgDBname;