diff --git a/upload/admin/controller/catalog/download.php b/upload/admin/controller/catalog/download.php index 02b32a4a289..33f2cbcae1f 100644 --- a/upload/admin/controller/catalog/download.php +++ b/upload/admin/controller/catalog/download.php @@ -470,7 +470,8 @@ public function upload() { // Allowed file extension types $allowed = array(); - $filetypes = explode("\n", $this->config->get('config_file_extension_allowed')); + $extension_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_extension_allowed')); + $filetypes = explode("\n", $extension_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); @@ -483,7 +484,8 @@ public function upload() { // Allowed file mime types $allowed = array(); - $filetypes = explode("\n", $this->config->get('config_file_mime_allowed')); + $mime_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_mime_allowed')); + $filetypes = explode("\n", $mime_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); @@ -554,4 +556,4 @@ public function autocomplete() { $this->response->setOutput(json_encode($json)); } } -?> \ No newline at end of file +?> diff --git a/upload/catalog/controller/common/header.php b/upload/catalog/controller/common/header.php index f1fc2d9b0dd..21f143809b0 100644 --- a/upload/catalog/controller/common/header.php +++ b/upload/catalog/controller/common/header.php @@ -54,7 +54,8 @@ protected function index() { $status = true; if (isset($this->request->server['HTTP_USER_AGENT'])) { - $robots = explode("\n", trim($this->config->get('config_robots'))); + $config_robots = preg_replace('~\r?\n~', "\n", trim($this->config->get('config_robots'))); + $robots = explode("\n", $config_robots); foreach ($robots as $robot) { if ($robot && strpos($this->request->server['HTTP_USER_AGENT'], trim($robot)) !== false) { @@ -125,4 +126,4 @@ protected function index() { $this->render(); } } -?> \ No newline at end of file +?> diff --git a/upload/catalog/controller/product/product.php b/upload/catalog/controller/product/product.php index 4a28d044676..759121f2598 100644 --- a/upload/catalog/controller/product/product.php +++ b/upload/catalog/controller/product/product.php @@ -684,7 +684,8 @@ public function upload() { // Allowed file extension types $allowed = array(); - $filetypes = explode("\n", $this->config->get('config_file_extension_allowed')); + $extension_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_extension_allowed')); + $filetypes = explode("\n", $extension_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); @@ -697,7 +698,8 @@ public function upload() { // Allowed file mime types $allowed = array(); - $filetypes = explode("\n", $this->config->get('config_file_mime_allowed')); + $mime_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_mime_allowed')); + $filetypes = explode("\n", $mime_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); @@ -728,4 +730,4 @@ public function upload() { $this->response->setOutput(json_encode($json)); } } -?> \ No newline at end of file +?>