summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class4
-rw-r--r--it_url.class1
2 files changed, 3 insertions, 2 deletions
diff --git a/it.class b/it.class
index 327b7ee..83cdfba 100644
--- a/it.class
+++ b/it.class
@@ -1185,7 +1185,7 @@ static function file_get($filename, $p = array())
{
if (isset($p['it_cache']) && ($key = "it_file_get_" . md5(json_encode([$filename, $p]))) && ($result = it_cache::get($key, $p['it_cache'])) !== null)
return $result;
- elseif (($data = it::file_get_contents($filename)) !== false)
+ elseif (($data = it::file_get_contents($filename == "-" ? "php://stdin" : $filename)) !== false)
{
if ($p['keyval'])
{
@@ -1318,7 +1318,7 @@ static function safe_filename($filename)
{
if (it::match("\.\./", $filename))
it::fatal(['title' => "../ contained in '$filename', aborted"]);
- $filename = it::replace(['^/dev/fd/(\d+)$' => 'php://fd/$1', '^-$' => 'php://stdin'], $filename);
+ $filename = it::replace(['^/dev/fd/(\d+)$' => 'php://fd/$1'], $filename);
return $filename;
}
diff --git a/it_url.class b/it_url.class
index a937212..26390eb 100644
--- a/it_url.class
+++ b/it_url.class
@@ -264,6 +264,7 @@ static function curl_opts($p=array())
$add += [CURLOPT_ENCODING => $p['accept_encoding']]; # NOTE: the curl library renamed the option to CURLOPT_ACCEPT_ENCODING, in php both are possible, CURLOPT_ENCODING is documented
return $add + [
+ CURLOPT_FORBID_REUSE => true,
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT_MS => $p['totaltimeout'] * 1000, # use _MS to support fractions of seconds