Skip to content

Commit

Permalink
Fixes:
Browse files Browse the repository at this point in the history
* Issue with preg_match()
* Undefined variables
  • Loading branch information
joezidell-saleswarp committed Aug 21, 2018
1 parent 4b71666 commit a4e71b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -913,7 +913,7 @@ public function name($data) {
)
);
}
if (preg_match('/^[\w-_\s]*[\w-_]+/', $data)) {
if (preg_match('/^[\w\-_\s]*[\w\-_]+/', $data)) {
return $this->cacheMethod(__FUNCTION__, $cacheKey, $this->startQuote . $data . $this->endQuote);
}
return $this->cacheMethod(__FUNCTION__, $cacheKey, $data);
Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -1164,9 +1164,13 @@ public function checkNotModified(CakeRequest $request) {
$modifiedSince = $request->header('If-Modified-Since');
if ($responseTag = $this->etag()) {
$etagMatches = in_array('*', $etags) || in_array($responseTag, $etags);
} else {
$etagMatches = false;
}
if ($modifiedSince) {
$timeMatches = strtotime($this->modified()) === strtotime($modifiedSince);
} else {
$timeMatches = false;
}
$checks = compact('etagMatches', 'timeMatches');
if (empty($checks)) {
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Utility/ObjectCollection.php
Expand Up @@ -95,6 +95,7 @@ public function trigger($callback, $params = array(), $options = array()) {
if (empty($this->_enabled)) {
return true;
}
$subject = null;
if ($callback instanceof CakeEvent) {
$event = $callback;
if (is_array($event->data)) {
Expand Down
5 changes: 5 additions & 0 deletions lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -1060,6 +1060,8 @@ public function input($fieldName, $options = array()) {
if ($options['type'] === 'radio' && isset($options['options'])) {
$radioOptions = (array)$options['options'];
unset($options['options']);
} else {
$radioOptions = [];
}

$label = $this->_getLabel($fieldName, $options);
Expand All @@ -1080,6 +1082,9 @@ public function input($fieldName, $options = array()) {
$dateFormat = $this->_extractOption('dateFormat', $options, 'MDY');
$timeFormat = $this->_extractOption('timeFormat', $options, 12);
unset($options['dateFormat'], $options['timeFormat']);
} else {
$dateFormat = 'MDY';
$timeFormat = 12;
}

$type = $options['type'];
Expand Down

0 comments on commit a4e71b3

Please sign in to comment.