Changeset 6870
- Timestamp:
- 01/01/08 03:04:58 (9 months ago)
- Files:
-
- branches/1.1/lib/util/sfCore.class.php (modified) (1 diff)
- branches/1.1/lib/validator/sfValidatorFile.class.php (modified) (1 diff)
- branches/1.1/test/bin/prove.php (modified) (1 diff)
- branches/1.1/test/bootstrap/functional.php (modified) (1 diff)
- branches/1.1/test/bootstrap/unit.php (modified) (1 diff)
- branches/1.1/test/unit/validator/sfValidatorFileTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/util/sfCore.class.php
r6868 r6870 99 99 100 100 ini_set('magic_quotes_runtime', 'off'); 101 ini_set('register_globals', 'off'); 101 102 102 103 // include all config.php from plugins branches/1.1/lib/validator/sfValidatorFile.class.php
r6807 r6870 170 170 foreach ($this->getOption('mime_type_guessers') as $method) 171 171 { 172 if (!is_null($type = call_user_func($method, $file))) 172 $type = call_user_func($method, $file); 173 174 if (!is_null($type) && $type !== false) 173 175 { 174 176 return $type; branches/1.1/test/bin/prove.php
r6859 r6870 4 4 * This file is part of the symfony package. 5 5 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 6 * 6 * 7 7 * For the full copyright and license information, please view the LICENSE 8 8 * file that was distributed with this source code. branches/1.1/test/bootstrap/functional.php
r5260 r6870 4 4 * This file is part of the symfony package. 5 5 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 6 * 6 * 7 7 * For the full copyright and license information, please view the LICENSE 8 8 * file that was distributed with this source code. 9 9 */ 10 11 // setup expected test environment (per check_configuration.php) 12 ini_set('magic_quotes_gpc', 'off'); 13 ini_set('register_globals', 'off'); 14 ini_set('session.auto_start', 'off'); 15 ini_set('arg.output_separator', '&'); 16 17 ini_set('allow_url_fopen', 'on'); 10 18 11 19 if (!isset($root_dir)) branches/1.1/test/bootstrap/unit.php
r5231 r6870 4 4 * This file is part of the symfony package. 5 5 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 6 * 6 * 7 7 * For the full copyright and license information, please view the LICENSE 8 8 * file that was distributed with this source code. 9 9 */ 10 11 // setup expected test environment (per check_configuration.php) 12 ini_set('magic_quotes_gpc', 'off'); 13 ini_set('register_globals', 'off'); 14 ini_set('session.auto_start', 'off'); 15 ini_set('arg.output_separator', '&'); 16 17 ini_set('allow_url_fopen', 'on'); 10 18 11 19 $_test_dir = realpath(dirname(__FILE__).'/..'); branches/1.1/test/unit/validator/sfValidatorFileTest.php
r6748 r6870 98 98 $t->is($v->guessFromFileBinary($tmpDir.'/test.txt'), 'text/plain', '->guessFromFileBinary() guesses the type of a given file'); 99 99 $t->is($v->guessFromFileBinary($tmpDir.'/foo.txt'), null, '->guessFromFileBinary() returns null if the file type is not guessable'); 100 $t->is($v->guessFromFileBinary('/bin/ls'), 'application/octet-stream', '->guessFromFileBinary() returns null if the file type is notguessable');100 $t->is($v->guessFromFileBinary('/bin/ls'), (PHP_OS != 'Darwin') ? 'application/x-executable' : 'application/octet-stream', '->guessFromFileBinary() returns correct type if file is guessable'); 101 101 102 102 // ->getMimeType()