diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 180371c9d8..8cef414be6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2012-04-24 Miguel de Dios + + * include/Image/image_functions.php: fixed into the function + "createthumb" when you have a path with "." character try to extract + the extension of file before of name of file. + + * include/config_process.php: disabled warning message of PHP5 about + the timezone. + + MERGED FROM 4.0.2 + 2012-04-24 Juan Manuel Ramon * include/functions_graph.php diff --git a/pandora_console/include/Image/image_functions.php b/pandora_console/include/Image/image_functions.php index e1056cedec..d7b9afbd61 100644 --- a/pandora_console/include/Image/image_functions.php +++ b/pandora_console/include/Image/image_functions.php @@ -84,17 +84,23 @@ function getFile ($destFileName,$fileLocation) { function createthumb ($origFileName, $destFileName, $newWidth, $newHeight) { //TODO $newWidth and $newHeight values as percent. - $system = explode(".",$origFileName); - if (preg_match ("/jpg|jpeg/",$system[1])) + preg_match("/\.(jpg|jpeg|png)$/", $origFileName, $match); + $extension = ''; + if (!empty($match)) + $extension = $match[1]; + + if (preg_match ("/jpg|jpeg/", $extension)) $src_img = imagecreatefromjpeg($origFileName); - if (preg_match ("/png/",$system[1])) + + if (preg_match ("/png/", $extension)) $src_img = imagecreatefrompng($origFileName); + $oldWidth = imageSX($src_img); $oldHeight = imageSY($src_img); - + $dst_img = ImageCreateTrueColor($newWidth, $newHeight); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $newWidth, $newHeight, $oldWidth, $oldHeight); - if (preg_match("/png/",$system[1])) + if (preg_match("/png/", $extension)) imagepng($dst_img,$destFileName); else imagejpeg($dst_img,$destFileName); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 94f947bb47..b99a45a540 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -25,7 +25,11 @@ $build_version = 'PC120214'; $pandora_version = 'v5.0-dev'; -date_default_timezone_set("Europe/Berlin"); +// Do not overwrite default timezone set if defined. +$script_tz = @date_default_timezone_get(); +if (empty($script_tz)){ + date_default_timezone_set("Europe/Berlin"); +} global $develop_bypass; /* Help to debug problems. Override global PHP configuration */