| @@ 1274-1282 (lines=9) @@ | ||
| 1271 | if ( ! ini_get('safe_mode') && function_usable('shell_exec')) |
|
| 1272 | { |
|
| 1273 | $mime = @shell_exec($cmd); |
|
| 1274 | if (strlen($mime) > 0) |
|
| 1275 | { |
|
| 1276 | $mime = explode("\n", trim($mime)); |
|
| 1277 | if (preg_match($regexp, $mime[(count($mime) - 1)], $matches)) |
|
| 1278 | { |
|
| 1279 | $this->file_type = $matches[1]; |
|
| 1280 | return; |
|
| 1281 | } |
|
| 1282 | } |
|
| 1283 | } |
|
| 1284 | ||
| 1285 | if (function_usable('popen')) |
|
| @@ 1292-1300 (lines=9) @@ | ||
| 1289 | { |
|
| 1290 | $mime = @fread($proc, 512); |
|
| 1291 | @pclose($proc); |
|
| 1292 | if ($mime !== FALSE) |
|
| 1293 | { |
|
| 1294 | $mime = explode("\n", trim($mime)); |
|
| 1295 | if (preg_match($regexp, $mime[(count($mime) - 1)], $matches)) |
|
| 1296 | { |
|
| 1297 | $this->file_type = $matches[1]; |
|
| 1298 | return; |
|
| 1299 | } |
|
| 1300 | } |
|
| 1301 | } |
|
| 1302 | } |
|
| 1303 | } |
|