فهرست منبع

- Fixing file upload/download troubles: make sure that magic_quotes_gpc is turned off and that the output is not truncated by AjaxWebPage.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@229 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 سال پیش
والد
کامیت
836332eb3f
2فایلهای تغییر یافته به همراه17 افزوده شده و 1 حذف شده
  1. 1 1
      application/ajaxwebpage.class.inc.php
  2. 16 0
      setup/index.php

+ 1 - 1
application/ajaxwebpage.class.inc.php

@@ -42,7 +42,7 @@ class ajax_page extends web_page
         }
         $s_captured_output = ob_get_contents();
         ob_end_clean();
-        echo trim($this->s_content);
+        echo $this->s_content;
         if (!empty($this->m_sReadyScript))
         {
 	        echo "<script>\n";

+ 16 - 0
setup/index.php

@@ -61,6 +61,15 @@ function CheckPHPVersion(setup_web_page $oP)
 		$bResult = false;
 	}
 	// Check some ini settings here
+	if (function_exists('php_ini_loaded_file')) // PHP >= 5.2.4
+	{
+		$sPhpIniFile = php_ini_loaded_file();
+		$oP->log("Info - php.ini path: '$sPhpIniFile'");
+	}
+	else
+	{
+		$sPhpIniFile = 'php.ini';
+	}
   	if (!ini_get('file_uploads'))
   	{
 		$oP->error("Files upload is not allowed on this server (file_uploads = ".ini_get('file_uploads').").");
@@ -107,6 +116,13 @@ function CheckPHPVersion(setup_web_page $oP)
 	$oP->log("Info - upload_max_filesize: ".ini_get('upload_max_filesize'));
 	$oP->log("Info - max_file_uploads: ".ini_get('max_file_uploads'));
 
+	// Check some more ini settings here, needed for file upload
+  	if (get_magic_quotes_gpc())
+  	{
+		$oP->error("'magic_quotes_gpc' is set to On in '$sPhpIniFile', please turn if Off before continuing.");
+		$bResult = false;
+	}
+	
 	return $bResult;
 }