diff --git a/include/Base.php b/include/Base.php index 023d57a..4deadac 100644 --- a/include/Base.php +++ b/include/Base.php @@ -24,7 +24,7 @@ abstract class Base{ public function RunCommands($cmd){ // POST commands - if( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cmd']) && $_POST['cmd'] === $cmd ){ + if( ($_SERVER['REQUEST_METHOD'] === 'POST') && isset($_POST['cmd']) && $_POST['cmd'] === $cmd ){ if( $this->_RunCommands($cmd, $this->cmds_post) ){ return; } diff --git a/include/image.php b/include/image.php index 4ed2bb0..c07983a 100644 --- a/include/image.php +++ b/include/image.php @@ -55,7 +55,7 @@ class gp_resized{ //make sure the index is set gp_resized::SetIndex(); - $index = \gp\tool::ArrayKey($_GET['i'], self::$index ); + $index = \gp\tool::ArrayKey($_GET['i'], (array)self::$index ); if( !$index ){ self::Send404(); //dies @@ -159,7 +159,7 @@ class gp_resized{ //check to see if the reduced image exists $info['name'] = $width.'x'.$height.'.'.$info['extension']; - $info['index'] = array_search($img,self::$index); + $info['index'] = array_search($img,(array)self::$index); return $info; } @@ -237,7 +237,7 @@ class gp_resized{ $meta = array('last_index'=>self::$last_index); $index_file = $dataDir.'/data/_site/image_index.php'; - return \gp\tool\Files::SaveData($index_file,'image_index',self::$index,'meta_data',$meta); + return \gp\tool\Files::SaveData($index_file,'image_index',(array)self::$index,'meta_data',$meta); } /**