Skip to content

Commit 5aece6d

Browse files
authored
Updates to flow.js (#2433)
1 parent 71998f5 commit 5aece6d

File tree

9 files changed

+1683
-456
lines changed

9 files changed

+1683
-456
lines changed

app/code/core/Mage/Catalog/Helper/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ public function validateUploadFile($filePath)
637637
}
638638

639639
if ($imageInfo[0] > $maxDimension || $imageInfo[1] > $maxDimension) {
640-
Mage::throwException($this->__('Disalollowed file format.'));
640+
Mage::throwException($this->__('Disallowed file format.'));
641641
}
642642

643643
$_processor = new Varien_Image($filePath);

app/code/core/Mage/Uploader/Model/Config/Uploader.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,23 @@ class Mage_Uploader_Model_Config_Uploader extends Mage_Uploader_Model_Config_Abs
103103
*/
104104
protected function _construct()
105105
{
106+
// Fix error where setting post_max_size or upload_max_filesize to 0
107+
// causes the flow.js to make infinite chunks and crash the browser
108+
$maxSize = $this->_getHelper()->getDataMaxSizeInBytes();
109+
110+
if ($maxSize === 0) {
111+
$maxSize = PHP_INT_MAX;
112+
}
113+
106114
$this
107-
->setChunkSize($this->_getHelper()->getDataMaxSizeInBytes())
115+
->setChunkSize($maxSize)
108116
->setWithCredentials(false)
109117
->setForceChunkSize(false)
110118
->setQuery(array(
111119
'form_key' => Mage::getSingleton('core/session')->getFormKey()
112120
))
113121
->setMethod(self::UPLOAD_TYPE)
122+
->setSimultaneousUploads(1)
114123
->setAllowDuplicateUploads(true)
115124
->setPrioritizeFirstAndLastChunk(false)
116125
->setTestChunks(self::TEST_CHUNKS)

app/design/adminhtml/default/default/layout/main.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ Layout for editor element
158158
<action method="addJs"><script>mage/adminhtml/variables.js</script></action>
159159
<action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
160160
<action method="addJs"><name>lib/uploader/flow.min.js</name></action>
161-
<action method="addJs"><name>lib/uploader/fusty-flow.js</name></action>
162-
<action method="addJs"><name>lib/uploader/fusty-flow-factory.js</name></action>
163161
<action method="addJs"><name>mage/adminhtml/uploader/instance.js</name></action>
164162
<action method="addJs"><script>mage/adminhtml/browser.js</script></action>
165163
<action method="addJs"><script>prototype/window.js</script></action>

app/locale/en_US/Mage_Catalog.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
"Details","Details"
259259
"Disabled","Disabled"
260260
"Disallowed file type.","Disallowed file type."
261-
"Disalollowed file format.","Disalollowed file format."
261+
"Disallowed file format.","Disallowed file format."
262262
"Display Actual Price","Display Actual Price"
263263
"Display Page Control","Display Page Control"
264264
"Display Price Interval as One Price","Display Price Interval as One Price"

0 commit comments

Comments
 (0)