We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3f8ac4 commit c1bf16eCopy full SHA for c1bf16e
classes/Tools.php
@@ -2107,6 +2107,13 @@ public static function file_get_contents(
2107
*/
2108
public static function createFileFromUrl($url)
2109
{
2110
+ //TODO use Validate::isUrl instead when it will be less permissive and also allows schemes to be validated
2111
+ $scheme = parse_url($url, PHP_URL_SCHEME);
2112
+
2113
+ // Check if the scheme is allowed
2114
+ if (!in_array(strtolower($scheme), ['http', 'https'], true)) {
2115
+ return false;
2116
+ }
2117
$remoteFile = fopen($url, 'rb');
2118
if (!$remoteFile) {
2119
return false;
0 commit comments