From 24d28287e0c5606aa45b23c6e3c17628d89468f7 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Tue, 18 Feb 2020 22:00:09 -0500 Subject: [PATCH] actually fix the check for the empty path I should not code after traveling on planes for 12 hours --- src/p3k/HTTP/Test.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p3k/HTTP/Test.php b/src/p3k/HTTP/Test.php index d3397b0..f81620b 100644 --- a/src/p3k/HTTP/Test.php +++ b/src/p3k/HTTP/Test.php @@ -56,12 +56,12 @@ class Test implements Transport { private function _read_file($url) { $parts = parse_url($url); - if($parts['path']) { + if(!empty($parts['path'])) { $parts['path'] = '/'.str_replace('/','_',substr($parts['path'],1)); - if(!isset($parts['path']) || $parts['path'] == '/') - $parts['path'] = '/_'; - $filepathurl = self::_build_url($parts); } + if(!isset($parts['path']) || $parts['path'] == '/') + $parts['path'] = '/_'; + $filepathurl = self::_build_url($parts); $filename = $this->_testDataPath.preg_replace('/https?:\/\//', '', $filepathurl); if(!file_exists($filename)) {