mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
c8a0c3b0f5
- string returned by magic_* are freed on magic_close, duplicate before calling magic_close (set return value) - if stat failed, don't try to call magic_* (when FILEINFO_MODE_FILE)
27 lines
584 B
PHP
27 lines
584 B
PHP
--TEST--
|
|
finfo_file(): Testing file names
|
|
--FILE--
|
|
<?php
|
|
|
|
$fp = finfo_open();
|
|
var_dump(finfo_file($fp, "\0"));
|
|
var_dump(finfo_file($fp, ''));
|
|
var_dump(finfo_file($fp, NULL));
|
|
var_dump(finfo_file($fp, '.'));
|
|
var_dump(finfo_file($fp, '&'));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: finfo_file(): Empty filename or path in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: finfo_file(): Empty filename or path in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: finfo_file(): Empty filename or path in %s on line %d
|
|
bool(false)
|
|
string(9) "directory"
|
|
|
|
Warning: finfo_file(): File or path not found '&' in %s on line %d
|
|
bool(false)
|