Skip to content

Commit a1f4a52

Browse files
authored
Disable file_exists check whenever a protocol format ^([\w.]+):\/\/ is detected. (#85)
1 parent cb0ea82 commit a1f4a52

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/XmlStringStreamer/Stream/File.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@ public function __construct($mixed, $chunkSize = 16384, $chunkCallback = null)
1616
// Account for common stream/URL wrappers before checking if a file exists
1717
$realPath = $mixed;
1818
if (preg_match('/^([\w.]+):\/\//', $realPath, $matched)) {
19-
if (preg_match('/(http|ftp|php|data|ssh2)/', $matched[1])) {
20-
// Disable file_exists() check
21-
$realPath = null;
22-
} else {
23-
// Remove wrapper for file_exists() check.
24-
$realPath = substr($realPath, strlen($matched[0]));
25-
}
19+
// Disable file_exists() check
20+
$realPath = null;
2621
}
2722
// If there's a real disk path to check, make sure it exists
2823
if ($realPath !== null && !file_exists($realPath)) {

0 commit comments

Comments
 (0)