Skip to content

Commit e329856

Browse files
mentalstringthePanz
authored andcommitted
fix use of null on string parameter
1 parent ec39ab9 commit e329856

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/generator/sfModelGenerator.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function renderField($field)
273273
}
274274
else if ('Date' == $field->getType())
275275
{
276-
$html = sprintf("false !== strtotime($html) ? format_date(%s, \"%s\") : ' '", $html, $field->getConfig('date_format', 'f'));
276+
$html = sprintf("is_string($html) && false !== strtotime($html) ? format_date(%s, \"%s\") : ' '", $html, $field->getConfig('date_format', 'f'));
277277
}
278278
else if ('Boolean' == $field->getType())
279279
{

lib/util/sfBrowserBase.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ public function doClickElement(DOMElement $item, $arguments = array(), $options
911911
}
912912
else
913913
{
914-
$queryString = is_array($arguments) ? http_build_query($arguments, null, '&') : '';
914+
$queryString = is_array($arguments) ? http_build_query($arguments, '', '&') : '';
915915
$sep = false === strpos($url, '?') ? '?' : '&';
916916

917917
return array($url.($queryString ? $sep.$queryString : ''), 'get', array());

lib/view/sfViewCacheManager.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,8 @@ public function getCurrentCacheKey()
10051005

10061006
if ($getParameters = $this->request->getGetParameters())
10071007
{
1008-
$cacheKey .= false === strpos($cacheKey, '?') ? '?' : '&';
1009-
$cacheKey .= http_build_query($getParameters, null, '&');
1008+
$cacheKey .= false === strpos((string) $cacheKey, '?') ? '?' : '&';
1009+
$cacheKey .= http_build_query($getParameters, '', '&');
10101010
}
10111011

10121012
return $cacheKey;

test/unit/sfNoRouting.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getCurrentInternalUri($with_route_name = false)
2929
// other parameters
3030
unset($parameters['module'], $parameters['action']);
3131
ksort($parameters);
32-
$parameters = count($parameters) ? '?'.http_build_query($parameters, null, '&') : '';
32+
$parameters = count($parameters) ? '?'.http_build_query($parameters, '', '&') : '';
3333

3434
return sprintf('%s%s', $action, $parameters);
3535
}
@@ -49,7 +49,7 @@ public function generate($name, $params = array(), $absolute = false)
4949
unset($parameters['action']);
5050
}
5151

52-
$parameters = http_build_query($parameters, null, '&');
52+
$parameters = http_build_query($parameters, '', '&');
5353

5454
return $this->fixGeneratedUrl('/'.($parameters ? '?'.$parameters : ''), $absolute);
5555
}

0 commit comments

Comments
 (0)