Procházet zdrojové kódy

[ZF-7976] Zend_File:

- workaround for broken web server implementations not conforming HTTP

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18441 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas před 16 roky
rodič
revize
4f22816da7
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      library/Zend/File/Transfer/Adapter/Http.php

+ 9 - 1
library/Zend/File/Transfer/Adapter/Http.php

@@ -120,8 +120,16 @@ class Zend_File_Transfer_Adapter_Http extends Zend_File_Transfer_Adapter_Abstrac
      */
     public function isValid($files = null)
     {
+        // Workaround for WebServer not conforming HTTP and omitting CONTENT_LENGTH
+        $content = 0;
+        if (isset($_SERVER['CONTENT_LENGTH'])) {
+            $content = $_SERVER['CONTENT_LENGTH'];
+        } else if (!empty($_POST)) {
+            $content = serialize($_POST);
+        }
+
         // Workaround for a PHP error returning empty $_FILES when form data exceeds php settings
-        if (empty($this->_files) && ($_SERVER['CONTENT_LENGTH'] > 0)) {
+        if (empty($this->_files) && ($content > 0)) {
             if (is_array($files)) {
                 $files = current($files);
             }