mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Only parse URLs when they contain ://
Parsing incomplete URLs fails in PHP5.2.
This commit is contained in:
parent
5469840c80
commit
51909ae738
1 changed files with 6 additions and 4 deletions
|
@ -466,11 +466,13 @@ class FormHelper extends AppHelper {
|
|||
$this->setEntity($model, true);
|
||||
$this->_introspectModel($model, 'fields');
|
||||
}
|
||||
|
||||
$this->_lastAction = $action;
|
||||
if (strpos($action, '://')) {
|
||||
$query = parse_url($action, PHP_URL_QUERY);
|
||||
if ($query) {
|
||||
$query = '?' . $query;
|
||||
}
|
||||
$query = $query ? '?' . $query : '';
|
||||
$this->_lastAction = parse_url($action, PHP_URL_PATH) . $query;
|
||||
}
|
||||
|
||||
return $this->Html->useTag('form', $action, $htmlAttributes) . $append;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue