diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
commit | 1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc (patch) | |
tree | 54655ff3e692a71a17f1d37cd97374b263557ca1 /lib/class/core.class.php | |
parent | ef48bf3fbdca2a4d25f5d025f4c6ad23905e5369 (diff) | |
download | ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.gz ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.bz2 ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.zip |
Cosmetics: remove trailing whitespace
Diffstat (limited to 'lib/class/core.class.php')
-rw-r--r-- | lib/class/core.class.php | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/lib/class/core.class.php b/lib/class/core.class.php index 5162c20b..683107d3 100644 --- a/lib/class/core.class.php +++ b/lib/class/core.class.php @@ -31,9 +31,9 @@ class Core { * constructor * This doesn't do anything */ - private function __construct() { + private function __construct() { - return false; + return false; } // construction @@ -42,25 +42,25 @@ class Core { * This registers a form with a SID, inserts it into the session variables * and then returns a string for use in the HTML form */ - public static function form_register($name,$type='post') { + public static function form_register($name,$type='post') { // Make ourselves a nice little sid $sid = md5(uniqid(rand(), true)); // Register it - $_SESSION['forms'][$name] = array('sid'=>$sid,'expire'=>time() + Config::get('session_length')); - - switch ($type) { - default: - case 'post': - $string = '<input type="hidden" name="form_validation" value="' . $sid . '" />'; - break; - case 'get': - $string = $sid; - break; + $_SESSION['forms'][$name] = array('sid'=>$sid,'expire'=>time() + Config::get('session_length')); + + switch ($type) { + default: + case 'post': + $string = '<input type="hidden" name="form_validation" value="' . $sid . '" />'; + break; + case 'get': + $string = $sid; + break; } // end switch on type - return $string; + return $string; } // form_register @@ -69,30 +69,30 @@ class Core { * This takes a form name and then compares it with the posted sid, if they don't match * then it returns false and doesn't let the person continue */ - public static function form_verify($name,$method='post') { + public static function form_verify($name,$method='post') { - switch ($method) { - case 'post': - $source = $_POST['form_validation']; - break; - case 'get': + switch ($method) { + case 'post': + $source = $_POST['form_validation']; + break; + case 'get': $source = $_GET['form_validation']; - break; - case 'cookie': - $source = $_COOKIE['form_validation']; - break; - case 'request': - $source = $_REQUEST['form_validation']; - break; - } - - if ($source == $_SESSION['forms'][$name]['sid'] AND $_SESSION['forms'][$name]['expire'] > time()) { - unset($_SESSION['forms'][$name]); - return true; - } - - unset($_SESSION['forms'][$name]); - return false; + break; + case 'cookie': + $source = $_COOKIE['form_validation']; + break; + case 'request': + $source = $_REQUEST['form_validation']; + break; + } + + if ($source == $_SESSION['forms'][$name]['sid'] AND $_SESSION['forms'][$name]['expire'] > time()) { + unset($_SESSION['forms'][$name]); + return true; + } + + unset($_SESSION['forms'][$name]); + return false; } // form_verify @@ -101,21 +101,21 @@ class Core { * This returns the dimensions of the passed song of the passed type * returns an empty array if PHP-GD is not currently installed, returns * false on error - */ - public static function image_dimensions($image_data) { + */ + public static function image_dimensions($image_data) { - if (!function_exists('ImageCreateFromString')) { return false; } + if (!function_exists('ImageCreateFromString')) { return false; } - $image = ImageCreateFromString($image_data); + $image = ImageCreateFromString($image_data); - if (!$image) { return false; } + if (!$image) { return false; } - $width = imagesx($image); - $height = imagesy($image); + $width = imagesx($image); + $height = imagesy($image); - if (!$width || !$height) { return false; } + if (!$width || !$height) { return false; } - return array('width'=>$width,'height'=>$height); + return array('width'=>$width,'height'=>$height); } // image_dimensions |