Skip to content
Permalink
Browse files

Only parse URLs when they contain ://

Parsing incomplete URLs fails in PHP5.2.
  • Loading branch information...
markstory committed May 9, 2014
1 parent 5469840 commit 51909ae7388b4c2fee24bce8cb78e75dbe8e82dc
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/Cake/View/Helper/FormHelper.php
@@ -466,11 +466,13 @@ public function create($model = null, $options = array()) {
$this->setEntity($model, true);
$this->_introspectModel($model, 'fields');
}
$query = parse_url($action, PHP_URL_QUERY);
if ($query) {
$query = '?' . $query;
$this->_lastAction = $action;
if (strpos($action, '://')) {
$query = parse_url($action, PHP_URL_QUERY);
$query = $query ? '?' . $query : '';
$this->_lastAction = parse_url($action, PHP_URL_PATH) . $query;
}
$this->_lastAction = parse_url($action, PHP_URL_PATH) . $query;
return $this->Html->useTag('form', $action, $htmlAttributes) . $append;
}

0 comments on commit 51909ae

Please sign in to comment.
You can’t perform that action at this time.