You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: getid3/getid3.php
+15-12
Original file line number
Diff line number
Diff line change
@@ -266,14 +266,16 @@ public function __construct() {
266
266
}
267
267
268
268
// Check memory
269
-
$this->memory_limit = ini_get('memory_limit');
270
-
if (preg_match('#([0-9]+) ?M#i', $this->memory_limit, $matches)) {
269
+
$memoryLimit = ini_get('memory_limit');
270
+
if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) {
271
271
// could be stored as "16M" rather than 16777216 for example
272
-
$this->memory_limit = $matches[1] * 1048576;
273
-
} elseif (preg_match('#([0-9]+) ?G#i', $this->memory_limit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
272
+
$memoryLimit = $matches[1] * 1048576;
273
+
} elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
274
274
// could be stored as "2G" rather than 2147483648 for example
275
-
$this->memory_limit = $matches[1] * 1073741824;
275
+
$memoryLimit = $matches[1] * 1073741824;
276
276
}
277
+
$this->memory_limit = $memoryLimit;
278
+
277
279
if ($this->memory_limit <= 0) {
278
280
// memory limits probably disabled
279
281
} elseif ($this->memory_limit <= 4194304) {
@@ -287,7 +289,7 @@ public function __construct() {
287
289
$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
288
290
}
289
291
290
-
if (($mbstring_func_overload = ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
292
+
if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
291
293
// http://php.net/manual/en/mbstring.overload.php
292
294
// "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions"
293
295
// getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.
@@ -400,8 +402,9 @@ public function setOption($optArray) {
400
402
}
401
403
402
404
/**
403
-
* @param string $filename
404
-
* @param int $filesize
405
+
* @param string $filename
406
+
* @param int $filesize
407
+
* @param resource $fp
405
408
*
406
409
* @return bool
407
410
*
@@ -511,9 +514,10 @@ public function openfile($filename, $filesize=null, $fp=null) {
511
514
/**
512
515
* analyze file
513
516
*
514
-
* @param string $filename
515
-
* @param int $filesize
516
-
* @param string $original_filename
517
+
* @param string $filename
518
+
* @param int $filesize
519
+
* @param string $original_filename
520
+
* @param resource $fp
517
521
*
518
522
* @return array
519
523
*/
@@ -1534,7 +1538,6 @@ public function getHashdata($algorithm) {
1534
1538
1535
1539
default:
1536
1540
return$this->error('bad algorithm "'.$algorithm.'" in getHashdata()');
0 commit comments