Skip to content

Commit

Permalink
App/modules/admin/controllers/slider.php - General bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
code-path committed Apr 20, 2024
1 parent 76e5295 commit abcdb1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/modules/admin/controllers/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function create()
die("Image can't be empty");
}

if(!filter_var($data['image'], FILTER_VALIDATE_URL))
if(!filter_var($data['image'], FILTER_VALIDATE_URL) && strpos($data['image'], '{image_path}') === false)
$data['image'] = '{image_path}' . $data['image'];

$this->slider_model->add($data);
Expand Down Expand Up @@ -214,7 +214,7 @@ public function save($id = false)
$data["body"] = $this->input->post("text_body");
$data["footer"] = $this->input->post("text_footer");

if(!filter_var($data['image'], FILTER_VALIDATE_URL))
if(!filter_var($data['image'], FILTER_VALIDATE_URL) && strpos($data['image'], '{image_path}') === false)
$data['image'] = '{image_path}' . $data['image'];

$this->slider_model->edit($id, $data);
Expand Down

0 comments on commit abcdb1f

Please sign in to comment.