| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* E2pdf Filter Helper |
| 5 |
* |
| 6 |
* @copyright Copyright 2017 https://e2pdf.com |
| 7 |
* @license GPL v2 |
| 8 |
* @version 1 |
| 9 |
* @link https://e2pdf.com |
| 10 |
* @since 1.07.09 |
| 11 |
*/ |
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
die('Access denied.'); |
| 14 |
} |
| 15 |
|
| 16 |
class Helper_E2pdf_Filter { |
| 17 |
|
| 18 |
public function is_stream($file_path) { |
| 19 |
if (strpos($file_path, '://') > 0) { |
| 20 |
$wrappers = array( |
| 21 |
'phar' |
| 22 |
); |
| 23 |
if (function_exists('stream_get_wrappers')) { |
| 24 |
$wrappers = stream_get_wrappers(); |
| 25 |
} |
| 26 |
|
| 27 |
foreach ($wrappers as $wrapper) { |
| 28 |
if (in_array($wrapper, ['http', 'https', 'file'])) { |
| 29 |
continue; |
| 30 |
} |
| 31 |
if (stripos($file_path, $wrapper . '://') === 0) { |
| 32 |
return true; |
| 33 |
} |
| 34 |
} |
| 35 |
} |
| 36 |
return false; |
| 37 |
} |
| 38 |
|
| 39 |
} |
| 40 |
|