summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Image_lib.php19
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 7 insertions, 13 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 06cdde0b8..39a30f0f5 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -544,35 +544,28 @@ class CI_Image_lib {
*/
if ($this->new_image === '')
{
- $this->dest_image = $this->source_image;
+ $this->dest_image = $this->source_image;
$this->dest_folder = $this->source_folder;
}
- elseif (strpos($this->new_image, '/') === FALSE)
+ elseif (strpos($this->new_image, '/') === FALSE && strpos($this->new_image, '\\') === FALSE)
{
+ $this->dest_image = $this->new_image;
$this->dest_folder = $this->source_folder;
- $this->dest_image = $this->new_image;
}
else
{
- if (strpos($this->new_image, '/') === FALSE && strpos($this->new_image, '\\') === FALSE)
- {
- $full_dest_path = str_replace('\\', '/', realpath($this->new_image));
- }
- else
- {
- $full_dest_path = $this->new_image;
- }
+ $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))
{
+ $this->dest_image = $this->source_image;
$this->dest_folder = $full_dest_path.'/';
- $this->dest_image = $this->source_image;
}
else
{
$x = explode('/', $full_dest_path);
- $this->dest_image = end($x);
+ $this->dest_image = end($x);
$this->dest_folder = str_replace($this->dest_image, '', $full_dest_path);
}
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 1ce3f071f..2509c8297 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -26,6 +26,7 @@ Bug fixes for 3.1.3
- Fixed a bug (#4927) - :doc:`Output Library <libraries/output>` method ``get_header()`` returned the first matching header, regardless of whether it would be replaced by a second ``set_header()`` call.
- Fixed a bug (#4844) - :doc:`Email Library <libraries/email>` didn't apply ``escapeshellarg()`` to the while passing the Sendmail ``-f`` parameter through ``popen()``.
- Fixed a bug (#4928) - the bootstrap file didn't check if *config/constants.php* exists before trying to load it.
+- Fixed a bug (#4937) - :doc:`Image Manipulation Library <libraries/image_lib>` method ``initialize()`` didn't translate *new_image* inputs to absolute paths.
Version 3.1.2
=============