summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-19 14:13:32 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-19 14:13:32 +0100
commit63a21005ec657aa004b5ffc2b0965c1a201e4637 (patch)
tree561ea2a2e0b9c547a9f967bb48cf84ffd86f7393
parent4f2933d28370ad965059222553d8ace1dd2fe602 (diff)
Some more cleaning
-rw-r--r--system/helpers/array_helper.php13
-rw-r--r--system/helpers/captcha_helper.php8
-rw-r--r--system/helpers/cookie_helper.php4
3 files changed, 10 insertions, 15 deletions
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index a454f936d..82f0eb16c 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -9,7 +9,7 @@
* Licensed under the Open Software License version 3.0
*
* This source file is subject to the Open Software License (OSL 3.0) that is
- * bundled with this package in the files license.txt / license.rst. It is
+ * bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
* http://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to obtain it
@@ -53,12 +53,7 @@ if ( ! function_exists('element'))
{
function element($item, $array, $default = FALSE)
{
- if ( ! isset($array[$item]) OR $array[$item] == "")
- {
- return $default;
- }
-
- return $array[$item];
+ return ( ! isset($array[$item]) OR $array[$item] == '') ? $default : $array[$item];
}
}
@@ -75,7 +70,7 @@ if ( ! function_exists('random_element'))
{
function random_element($array)
{
- return (is_array($array)) ? $array[array_rand($array)] : $array;
+ return is_array($array) ? $array[array_rand($array)] : $array;
}
}
@@ -105,7 +100,7 @@ if ( ! function_exists('elements'))
foreach ($items as $item)
{
- $return[$item] = (isset($array[$item])) ? $array[$item] : $default;
+ $return[$item] = isset($array[$item]) ? $array[$item] : $default;
}
return $return;
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 89bff2366..0565457e2 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -9,7 +9,7 @@
* Licensed under the Open Software License version 3.0
*
* This source file is subject to the Open Software License (OSL 3.0) that is
- * bundled with this package in the files license.txt / license.rst. It is
+ * bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
* http://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to obtain it
@@ -170,7 +170,7 @@ if ( ! function_exists('create_captcha'))
}
else
{
- $font_size = 16;
+ $font_size = 16;
$x = rand(0, $img_width/($length/1.5));
$y = $font_size+2;
}
@@ -192,7 +192,7 @@ if ( ! function_exists('create_captcha'))
}
- // Create the border
+ // Create the border
imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color);
// -----------------------------------
@@ -200,7 +200,7 @@ if ( ! function_exists('create_captcha'))
// -----------------------------------
$img_name = $now.'.jpg';
ImageJPEG($im, $img_path.$img_name);
- $img = "<img src=\"$img_url$img_name\" width=\"$img_width\" height=\"$img_height\" style=\"border:0;\" alt=\" \" />";
+ $img = '<img src="'.$img_url.$img_name.'" style="width: '.$img_width.'; height: '.$img_height .'; border: 0;" alt=" " />';
ImageDestroy($im);
return array('word' => $word, 'time' => $now, 'image' => $img);
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index d6f836670..52f489b39 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -9,7 +9,7 @@
* Licensed under the Open Software License version 3.0
*
* This source file is subject to the Open Software License (OSL 3.0) that is
- * bundled with this package in the files license.txt / license.rst. It is
+ * bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
* http://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to obtain it
@@ -91,7 +91,7 @@ if ( ! function_exists('get_cookie'))
* Delete a COOKIE
*
* @param mixed
- * @param string the cookie domain. Usually: .yourdomain.com
+ * @param string the cookie domain. Usually: .yourdomain.com
* @param string the cookie path
* @param string the cookie prefix
* @return void