Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use preg_match instead of eregi #1

Closed
wants to merge 1 commit into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 24, 2012
  1. @sluu99

    replaced eregi with preg_match

    sluu99 authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 code/getid3.php
View
6 code/getid3.php
@@ -60,7 +60,7 @@ function getID3()
// Check memory
$memory_limit = ini_get('memory_limit');
- if (eregi('([0-9]+)M', $memory_limit, $matches)) {
+ if (preg_match('/([0-9]+)M/i', $memory_limit, $matches)) {
// could be stored as "16M" rather than 16777216 for example
$memory_limit = $matches[1] * 1048576;
}
@@ -212,13 +212,13 @@ function analyze($filename) {
if (GETID3_OS_ISWINDOWS) {
$commandline = 'dir /-C "'.str_replace('/', DIRECTORY_SEPARATOR, $filename).'"';
$dir_output = `$commandline`;
- if (eregi('1 File\(s\)[ ]+([0-9]+) bytes', $dir_output, $matches)) {
+ if (preg_match('/1 File\(s\)[ ]+([0-9]+) bytes/i', $dir_output, $matches)) {
$real_filesize = (float) $matches[1];
}
} else {
$commandline = 'ls -o -g -G --time-style=long-iso '.escapeshellarg($filename);
$dir_output = `$commandline`;
- if (eregi('([0-9]+) ([0-9]{4}-[0-9]{2}\-[0-9]{2} [0-9]{2}:[0-9]{2}) '.preg_quote($filename).'$', $dir_output, $matches)) {
+ if (preg_match('/([0-9]+) ([0-9]{4}-[0-9]{2}\-[0-9]{2} [0-9]{2}:[0-9]{2}) /i'.preg_quote($filename).'$', $dir_output, $matches)) {
$real_filesize = (float) $matches[1];
}
}
Something went wrong with that request. Please try again.