Browse Source

actually fix the check for the empty path

I should not code after traveling on planes for 12 hours
master 0.1.11
Aaron Parecki 1 year ago
parent
commit
24d28287e0
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/p3k/HTTP/Test.php

+ 4
- 4
src/p3k/HTTP/Test.php View File

@ -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)) {

Loading…
Cancel
Save