Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit bf3fa57

Browse files
committed
Merge branch 'feature/55' into develop
Close #55
2 parents 739af0f + 0eab328 commit bf3fa57

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ All notable changes to this project will be documented in this file, in reverse
1515

1616
### Removed
1717

18-
- Nothing.
18+
- [#55](https://github.com/zendframework/zend-validator/pull/55) removes some
19+
checks for `safe_mode` within the `MimeType` validator, as `safe_mode` became
20+
obsolete starting with PHP 5.4.
1921

2022
### Fixed
2123

src/File/MimeType.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,16 @@ public function getMagicFile()
148148
return $this->options['magicFile'];
149149
}
150150

151-
ErrorHandler::start();
152-
$safeMode = ini_get('safe_mode');
153-
ErrorHandler::stop();
154-
155-
if (!($safeMode == 'On' || $safeMode === 1)) {
156-
foreach ($this->magicFiles as $file) {
157-
// suppressing errors which are thrown due to openbase_dir restrictions
158-
try {
159-
$this->setMagicFile($file);
160-
if ($this->options['magicFile'] !== null) {
161-
break;
162-
}
163-
} catch (Exception\ExceptionInterface $e) {
164-
// Intentionally, catch and fall through
165-
}
151+
foreach ($this->magicFiles as $file) {
152+
try {
153+
$this->setMagicFile($file);
154+
} catch (Exception\ExceptionInterface $e) {
155+
// suppressing errors which are thrown due to open_basedir restrictions
156+
continue;
157+
}
158+
159+
if ($this->options['magicFile'] !== null) {
160+
return $this->options['magicFile'];
166161
}
167162
}
168163

0 commit comments

Comments
 (0)