diff --git a/lib/generator/sfModelGenerator.class.php b/lib/generator/sfModelGenerator.class.php index b52a2570a..e84a7e1fc 100644 --- a/lib/generator/sfModelGenerator.class.php +++ b/lib/generator/sfModelGenerator.class.php @@ -273,7 +273,7 @@ public function renderField($field) } else if ('Date' == $field->getType()) { - $html = sprintf("false !== strtotime($html) ? format_date(%s, \"%s\") : ' '", $html, $field->getConfig('date_format', 'f')); + $html = sprintf("is_string($html) && false !== strtotime($html) ? format_date(%s, \"%s\") : ' '", $html, $field->getConfig('date_format', 'f')); } else if ('Boolean' == $field->getType()) { diff --git a/lib/request/sfWebRequest.class.php b/lib/request/sfWebRequest.class.php index bf35cbcb4..cf7549fad 100644 --- a/lib/request/sfWebRequest.class.php +++ b/lib/request/sfWebRequest.class.php @@ -872,6 +872,9 @@ static public function convertFileInformation(array $taintedFiles) */ static protected function fixPhpFilesArray(array $data) { + // remove full_path added on php8.1 + unset($data['full_path']); + $fileKeys = array('error', 'name', 'size', 'tmp_name', 'type'); $keys = array_keys($data); sort($keys); diff --git a/lib/util/sfBrowserBase.class.php b/lib/util/sfBrowserBase.class.php index 535d8ac45..4267bb0a9 100755 --- a/lib/util/sfBrowserBase.class.php +++ b/lib/util/sfBrowserBase.class.php @@ -911,7 +911,7 @@ public function doClickElement(DOMElement $item, $arguments = array(), $options } else { - $queryString = is_array($arguments) ? http_build_query($arguments, null, '&') : ''; + $queryString = is_array($arguments) ? http_build_query($arguments, '', '&') : ''; $sep = false === strpos($url, '?') ? '?' : '&'; return array($url.($queryString ? $sep.$queryString : ''), 'get', array()); diff --git a/lib/view/sfViewCacheManager.class.php b/lib/view/sfViewCacheManager.class.php index f055e50f1..7416f83f2 100644 --- a/lib/view/sfViewCacheManager.class.php +++ b/lib/view/sfViewCacheManager.class.php @@ -1003,10 +1003,10 @@ public function getCurrentCacheKey() { $cacheKey = $this->routing->getCurrentInternalUri(); - if ($getParameters = $this->request->getGetParameters()) + if ($cacheKey && $getParameters = $this->request->getGetParameters()) { $cacheKey .= false === strpos($cacheKey, '?') ? '?' : '&'; - $cacheKey .= http_build_query($getParameters, null, '&'); + $cacheKey .= http_build_query($getParameters, '', '&'); } return $cacheKey; diff --git a/test/unit/sfNoRouting.class.php b/test/unit/sfNoRouting.class.php index 2899cccb0..fc13704c4 100644 --- a/test/unit/sfNoRouting.class.php +++ b/test/unit/sfNoRouting.class.php @@ -29,7 +29,7 @@ public function getCurrentInternalUri($with_route_name = false) // other parameters unset($parameters['module'], $parameters['action']); ksort($parameters); - $parameters = count($parameters) ? '?'.http_build_query($parameters, null, '&') : ''; + $parameters = count($parameters) ? '?'.http_build_query($parameters, '', '&') : ''; return sprintf('%s%s', $action, $parameters); } @@ -49,7 +49,7 @@ public function generate($name, $params = array(), $absolute = false) unset($parameters['action']); } - $parameters = http_build_query($parameters, null, '&'); + $parameters = http_build_query($parameters, '', '&'); return $this->fixGeneratedUrl('/'.($parameters ? '?'.$parameters : ''), $absolute); }