HTML normalization: use double-quotes on RFC and PMID quotes for consistency with...
[lhc/web/wiklou.git] / includes / AjaxFunctions.php
index 5d95820..73af03c 100644 (file)
@@ -1,16 +1,17 @@
 <?php
 
 if( !defined( 'MEDIAWIKI' ) )
-        die( -1 );
+        die( 1 );
 
 require_once('WebRequest.php');
 
 /**
- * Function converts an Javascript escaped string back into a string with specified charset (default is UTF-8).
+ * Function converts an Javascript escaped string back into a string with
+ * specified charset (default is UTF-8).
  * Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps
  *
- * @param string $source escaped with Javascript's escape() function
- * @param string $iconv_to destination character set will be used as second paramether in the iconv function. Default is UTF-8.
+ * @param $source String escaped with Javascript's escape() function
+ * @param $iconv_to String destination character set will be used as second paramether in the iconv function. Default is UTF-8.
  * @return string
  */
 function js_unescape($source, $iconv_to = 'UTF-8') {
@@ -54,7 +55,7 @@ function js_unescape($source, $iconv_to = 'UTF-8') {
  * Function coverts number of utf char into that character.
  * Function taken from: http://sk2.php.net/manual/en/function.utf8-encode.php#49336
  *
- * @param int $num
+ * @param $num Integer
  * @return utf8char
  */
 function code2utf($num){
@@ -90,14 +91,14 @@ class AjaxCachePolicy {
                        header ("Pragma: no-cache");                          // HTTP/1.0
                } else {
                        header ("Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->policy ) . " GMT");
-                       header ("Cache-Control: public,max-age={$this->policy}");
+                       header ("Cache-Control: s-max-age={$this->policy},public,max-age={$this->policy}");
                }
        }
 }
                        
 
 function wfSajaxSearch( $term ) {
-       global $wgContLang, $wgUser, $wgRequest, $wgAjaxCachePolicy;
+       global $wgContLang, $wgAjaxCachePolicy;
        $limit = 16;
        
        $l = new Linker;