summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-12 10:39:38 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-12 10:39:38 +0100
commitf2a613d67c23ba253f35a73d208e0dcaf6080b40 (patch)
tree92522216388298e7158fce28dca71ed09737229a
parent4f52ca95781580164ea429643eb252f0c2607f9f (diff)
Really fix #4937
-rw-r--r--system/libraries/Image_lib.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 39a30f0f5..475649c46 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -554,20 +554,20 @@ class CI_Image_lib {
}
else
{
- $full_dest_path = str_replace('\\', '/', realpath($this->new_image));
-
// Is there a file name?
- if ( ! preg_match('#\.(jpg|jpeg|gif|png)$#i', $full_dest_path))
+ if ( ! preg_match('#\.(jpg|jpeg|gif|png)$#i', $this->new_image))
{
$this->dest_image = $this->source_image;
- $this->dest_folder = $full_dest_path.'/';
+ $this->dest_folder = $this->new_image;
}
else
{
- $x = explode('/', $full_dest_path);
+ $x = explode('/', str_replace('\\', '/', $this->new_image));
$this->dest_image = end($x);
- $this->dest_folder = str_replace($this->dest_image, '', $full_dest_path);
+ $this->dest_folder = str_replace($this->dest_image, '', $this->new_image);
}
+
+ $this->dest_folder = realpath($this->dest_folder).'/';
}
/* Compile the finalized filenames/paths