typo
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index f7d0e46..31b72a7 100644 (file)
@@ -783,7 +783,7 @@ function wfMerge( $old, $mine, $yours, &$result ){
          wfEscapeShellArg( $yourtextName );
        $handle = popen( $cmd, 'r' );
 
-       if( fgets( $handle ) ){
+       if( fgets( $handle, 1024 ) ){
                $conflict = true;
        } else {
                $conflict = false;
@@ -960,19 +960,6 @@ function wfTimestampNow() {
        return wfTimestamp( TS_MW, time() );
 }
 
-/**
- * Sorting hack for MySQL 3, which doesn't use index sorts for DESC
- * No longer supported and nuked.
- */
-function wfInvertTimestamp( $ts ) {
-       wfDieDebugBacktrace("Inverted timestamps should be nuked away from all code\n");
-       return strtr(
-               $ts,
-               '0123456789',
-               '9876543210'
-       );
-}
-
 /**
  * Reference-counted warning suppression
  */
@@ -1064,4 +1051,37 @@ function wfIsWindows() {
        }   
 } 
 
+/**
+ * Swap two variables
+ */
+function swap( &$x, &$y ) {
+       $z = $x;
+       $x = $y;
+       $y = $z;
+}
+
+function wfGetSiteNotice() {
+       global $wgSiteNotice, $wgTitle, $wgOut;
+       $fname = 'wfGetSiteNotice';
+       wfProfileIn( $fname );
+
+       $notice = wfMsg( 'sitenotice' );
+       if($notice == '<sitenotice>') $notice = '';
+       # Allow individual wikis to turn it off
+       if ( $notice == '-' ) {
+               $notice = '';
+       } else {
+               if ($notice == '') {
+                       $notice = $wgSiteNotice;
+               }
+               if($notice != '-' && $notice != '') {
+                       $specialparser = new Parser();
+                       $parserOutput = $specialparser->parse( $notice, $wgTitle, $wgOut->mParserOptions, false );
+                       $notice = $parserOutput->getText();
+               }
+       }
+       wfProfileOut( $fname );
+       return $notice;
+}
+
 ?>