GetID3 used now deprecated functions like ereg and set_magic_quotes_runtime. Convert ereg to preg_match and throw an error if magic quotes are enabled on PHP >= 5.3.

git-svn-id: http://kusabax.cultnet.net/svn/repo/stable@216 73d99b7e-4f53-4972-b7b7-2ecd3c4d89ee
This commit is contained in:
Sazpaimon committed 2009-08-16 07:29:23 +00:00
1 parent 6afde4b284
commit 0bdb656e9a
4 files changed
+22 -17

No files matched your search

+5 -5
View File
@@ -20,7 +20,7 @@ class getid3_lib
if ($hex) {
$returnstring .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT);
} else {
$returnstring .= ' '.(ereg("[\x20-\x7E]", $string{$i}) ? $string{$i} : '¤');
$returnstring .= ' '.(preg_match("/[\x20-\x7E]/i", $string{$i}) ? $string{$i} : '¤');
}
if ($spaces) {
$returnstring .= ' ';
@@ -530,7 +530,7 @@ class getid3_lib
}
}
$commandline = GETID3_HELPERAPPSDIR.'md5sum.exe "'.str_replace('/', DIRECTORY_SEPARATOR, $file).'"';
if (ereg("^[\\]?([0-9a-f]{32})", strtolower(`$commandline`), $r)) {
if (preg_match("/^[\\]?([0-9a-f]{32})/", strtolower(`$commandline`), $r)) {
return $r[1];
}
@@ -538,7 +538,7 @@ class getid3_lib
// The following works under UNIX only
$file = str_replace('`', '\\`', $file);
if (ereg("^([0-9a-f]{32})[ \t\n\r]", `md5sum "$file"`, $r)) {
if (preg_match("/^([0-9a-f]{32})[ \t\n\r]/", `md5sum "$file"`, $r)) {
return $r[1];
}
@@ -565,14 +565,14 @@ class getid3_lib
}
}
$commandline = GETID3_HELPERAPPSDIR.'sha1sum.exe "'.str_replace('/', DIRECTORY_SEPARATOR, $file).'"';
if (ereg("^sha1=([0-9a-f]{40})", strtolower(`$commandline`), $r)) {
if (preg_match("/^sha1=([0-9a-f]{40})/", strtolower(`$commandline`), $r)) {
return $r[1];
}
} else {
$commandline = 'sha1sum '.escapeshellarg($file).'';
if (ereg("^([0-9a-f]{40})[ \t\n\r]", strtolower(`$commandline`), $r)) {
if (preg_match("/^([0-9a-f]{40})[ \t\n\r]/", strtolower(`$commandline`), $r)) {
return $r[1];
}