Switch some HTMLForms in special pages to OOUI
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 7a9b27b..c618426 100644 (file)
@@ -1756,7 +1756,7 @@ function wfMsgExt( $key, $options ) {
        }
 
        if ( in_array( 'escape', $options, true ) ) {
-               $string = htmlspecialchars ( $string );
+               $string = htmlspecialchars( $string );
        } elseif ( in_array( 'escapenoentities', $options, true ) ) {
                $string = Sanitizer::escapeHtmlAllowEntities( $string );
        }
@@ -2758,7 +2758,7 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(),
 
        $useLogPipe = false;
        if ( is_executable( '/bin/bash' ) ) {
-               $time = intval ( isset( $limits['time'] ) ? $limits['time'] : $wgMaxShellTime );
+               $time = intval( isset( $limits['time'] ) ? $limits['time'] : $wgMaxShellTime );
                if ( isset( $limits['walltime'] ) ) {
                        $wallTime = intval( $limits['walltime'] );
                } elseif ( isset( $limits['time'] ) ) {
@@ -2766,8 +2766,8 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(),
                } else {
                        $wallTime = intval( $wgMaxShellWallClockTime );
                }
-               $mem = intval ( isset( $limits['memory'] ) ? $limits['memory'] : $wgMaxShellMemory );
-               $filesize = intval ( isset( $limits['filesize'] ) ? $limits['filesize'] : $wgMaxShellFileSize );
+               $mem = intval( isset( $limits['memory'] ) ? $limits['memory'] : $wgMaxShellMemory );
+               $filesize = intval( isset( $limits['filesize'] ) ? $limits['filesize'] : $wgMaxShellFileSize );
 
                if ( $time > 0 || $mem > 0 || $filesize > 0 || $wallTime > 0 ) {
                        $cmd = '/bin/bash ' . escapeshellarg( "$IP/includes/limit.sh" ) . ' ' .
@@ -3495,7 +3495,7 @@ function wfGetPrecompiledData( $name ) {
 }
 
 /**
- * Get a cache key
+ * Make a cache key for the local wiki.
  *
  * @param string $args,...
  * @return string
@@ -3510,7 +3510,9 @@ function wfMemcKey( /*...*/ ) {
 }
 
 /**
- * Get a cache key for a foreign DB
+ * Make a cache key for a foreign DB.
+ *
+ * Must match what wfMemcKey() would produce in context of the foreign wiki.
  *
  * @param string $db
  * @param string $prefix
@@ -3520,6 +3522,7 @@ function wfMemcKey( /*...*/ ) {
 function wfForeignMemcKey( $db, $prefix /*...*/ ) {
        $args = array_slice( func_get_args(), 2 );
        if ( $prefix ) {
+               // Match wfWikiID() logic
                $key = "$db-$prefix:" . implode( ':', $args );
        } else {
                $key = $db . ':' . implode( ':', $args );
@@ -3527,6 +3530,24 @@ function wfForeignMemcKey( $db, $prefix /*...*/ ) {
        return str_replace( ' ', '_', $key );
 }
 
+/**
+ * Make a cache key with database-agnostic prefix.
+ *
+ * Doesn't have a wiki-specific namespace. Uses a generic 'global' prefix
+ * instead. Must have a prefix as otherwise keys that use a database name
+ * in the first segment will clash with wfMemcKey/wfForeignMemcKey.
+ *
+ * @since 1.26
+ * @param string $args,...
+ * @return string
+ */
+function wfGlobalCacheKey( /*...*/ ) {
+       $args = func_get_args();
+       $key = 'global:' . implode( ':', $args );
+       $key = str_replace( ' ', '_', $key );
+       return $key;
+}
+
 /**
  * Get an ASCII string identifying this wiki
  * This is used as a prefix in memcached keys