Commits

ashcs  committed 687a5ec Merge

Merge pull request #93 from Dolbager/patch-1

Added apache_request_headers for nginx

  • Participants
  • Parent commits 933829e, 43ffae6

Comments (0)

Files changed (1)

File include/functions.php

 //
 
 // Encodes the contents of $str so that they are safe to output on an (X)HTML page
+
+// For nginx
+if (!function_exists('apache_request_headers')) {
+        function apache_request_headers() {
+            foreach($_SERVER as $key=>$value) {
+                if (substr($key,0,5)=="HTTP_") {
+                    $key=str_replace(" ","-",ucwords(strtolower(str_replace("_"," ",substr($key,5)))));
+                    $out[$key]=$value;
+                }else{
+                    $out[$key]=$value;
+		}
+            }
+            return $out;
+        }
+}
 function forum_htmlencode($str)
 {
 	return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');