summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2011-12-30 13:22:50 +0100
committerAndrey Andreev <narf@bofh.bg>2011-12-30 13:22:50 +0100
commita948f07bde83e149d9fc75e9aaf7260efba39b55 (patch)
tree09d3058ff1b92d3e6d1779dc6ca50a57a7377040
parent64dbdfb60e0556177061db2eecdf899111ae4ac9 (diff)
Remove a str_split() from the previous commit - we can access string characters like we do in an indexed array anyways
-rw-r--r--system/libraries/Image_lib.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index d4fb51923..72621c9b4 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -171,15 +171,7 @@ class CI_Image_lib {
{
if ($val != '' AND preg_match('/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i', $val, $matches))
{
- if (strlen($matches[1]) === 6)
- {
- $val = '#'.$val;
- }
- else
- {
- $val = str_split($val, 1);
- $val = '#'.$val[0].$val[0].$val[1].$val[1].$val[2].$val[2];
- }
+ $val = (strlen($matches[1]) === 6) ? '#'.$val : '#'.$val[0].$val[0].$val[1].$val[1].$val[2].$val[2];
}
else
{