Skip to content

Commit

Permalink
Merge pull request opencart#756 from gob33/master
Browse files Browse the repository at this point in the history
Resolve issue opencart#738
  • Loading branch information
Daniel Kerr committed Jul 5, 2013
2 parents d547f9f + 56ec229 commit 5b40a9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 5 additions & 3 deletions upload/admin/controller/catalog/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -554,4 +556,4 @@ public function autocomplete() {
$this->response->setOutput(json_encode($json));
}
}
?>
?>
5 changes: 3 additions & 2 deletions upload/catalog/controller/common/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -125,4 +126,4 @@ protected function index() {
$this->render();
}
}
?>
?>
8 changes: 5 additions & 3 deletions upload/catalog/controller/product/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -728,4 +730,4 @@ public function upload() {
$this->response->setOutput(json_encode($json));
}
}
?>
?>

0 comments on commit 5b40a9b

Please sign in to comment.