Browse files

Fix deprecation-warnings with PHP 5.3.x (ereg -> preg_match)

git-svn-id: https://svn.php.net/repository/pear/packages/Image_Canvas/trunk@291761 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent ea79b2d commit c0c5c4f90b1dc3dd5ef1fab0a65b32b91f30c192 @neufeind neufeind committed Dec 6, 2009
Showing with 9 additions and 9 deletions.
  1. +2 −2 Image/Canvas.php
  2. +3 −3 Image/Canvas/GD.php
  3. +2 −2 Image/Canvas/PDF.php
  4. +2 −2 Image/Canvas/PS.php
View
4 Image/Canvas.php
@@ -730,7 +730,7 @@ function &factory($canvas, $params)
$error = 'PHP extension ming is required for output in swf format.';
$error .= 'Please install the ming extension (http://de.php.net/ming).';
- $error =& new PEAR_Error($error);
+ $error = new PEAR_Error($error);
return $error;
}
}
@@ -742,7 +742,7 @@ function &factory($canvas, $params)
$class = 'Image_Canvas_'. $canvas;
include_once 'Image/Canvas/'. str_replace('_', '/', $canvas) . '.php';
- $obj =& new $class($params);
+ $obj = new $class($params);
return $obj;
}
View
6 Image/Canvas/GD.php
@@ -1770,7 +1770,7 @@ function _version()
$php_info = ob_get_contents();
ob_end_clean();
- if (ereg("<td[^>]*>GD Version *<\/td><td[^>]*>([^<]*)<\/td>",
+ if (preg_match("/<td[^>]*>GD Version *<\/td><td[^>]*>([^<]*)<\/td>/",
$php_info, $result))
{
$version = $result[1];
@@ -1779,9 +1779,9 @@ function _version()
}
}
- if (ereg('1\.[0-9]{1,2}', $version)) {
+ if (preg_match('/1\.[0-9]{1,2}/', $version)) {
return 1;
- } elseif (ereg('2\.[0-9]{1,2}', $version)) {
+ } elseif (preg_match('/2\.[0-9]{1,2}/', $version)) {
return 2;
} else {
return 0;
View
4 Image/Canvas/PDF.php
@@ -993,14 +993,14 @@ function _version()
$php_info = ob_get_contents();
ob_end_clean();
- if (ereg("<td[^>]*>PDFlib GmbH Version *<\/td><td[^>]*>([^<]*)<\/td>",
+ if (preg_match("/<td[^>]*>PDFlib GmbH Version *<\/td><td[^>]*>([^<]*)<\/td>/",
$php_info, $result))
{
$version = $result[1];
}
}
- if (ereg('([0-9]{1,2})\.[0-9]{1,2}(\.[0-9]{1,2})?', trim($version), $result)) {
+ if (preg_match('/([0-9]{1,2})\.[0-9]{1,2}(\.[0-9]{1,2})?/', trim($version), $result)) {
return $result[1];
} else {
return $version;
View
4 Image/Canvas/PS.php
@@ -991,14 +991,14 @@ function _version()
$php_info = ob_get_contents();
ob_end_clean();
- if (ereg("<td[^>]*>pslib Version *<\/td><td[^>]*>([^<]*)<\/td>",
+ if (preg_match("/<td[^>]*>pslib Version *<\/td><td[^>]*>([^<]*)<\/td>/",
$php_info, $result))
{
$version = $result[1];
}
}
- if (ereg('([0-9]{1,2})\.[0-9]{1,2}(\.[0-9]{1,2})?', trim($version), $result)) {
+ if (preg_match('/([0-9]{1,2})\.[0-9]{1,2}(\.[0-9]{1,2})?/', trim($version), $result)) {
return $result[1];
} else {
return $version;

0 comments on commit c0c5c4f

Please sign in to comment.