浏览代码

only enable ob_gzhandler if it exists

Andrew Dolgov 12 年之前
父节点
当前提交
6a79e8afeb
共有 3 个文件被更改,包括 6 次插入4 次删除
  1. 3 1
      api/index.php
  2. 1 1
      backend.php
  3. 2 2
      public.php

+ 3 - 1
api/index.php

@@ -21,7 +21,9 @@
 
 	chdir("..");
 
-	if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT) {
+	if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT &&
+			function_exists("ob_gzhandler")) {
+
 		ob_start("ob_gzhandler");
 	}
 

+ 1 - 1
backend.php

@@ -56,7 +56,7 @@
 
 	header("Content-Type: text/plain; charset=utf-8");
 
-	if (ENABLE_GZIP_OUTPUT) {
+	if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
 		ob_start("ob_gzhandler");
 	}
 

+ 2 - 2
public.php

@@ -1,5 +1,5 @@
 <?php
-	set_include_path(get_include_path() . PATH_SEPARATOR . 
+	set_include_path(get_include_path() . PATH_SEPARATOR .
 		dirname(__FILE__) . "/include");
 
 	/* remove ill effects of magic quotes */
@@ -34,7 +34,7 @@
 
 	if (!init_connection($link)) return;
 
-	if (ENABLE_GZIP_OUTPUT) {
+	if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
 		ob_start("ob_gzhandler");
 	}