mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixes:
* Issue with preg_match() * Undefined variables
This commit is contained in:
parent
4b71666255
commit
a4e71b3b40
4 changed files with 11 additions and 1 deletions
|
@ -913,7 +913,7 @@ class DboSource extends DataSource {
|
|||
)
|
||||
);
|
||||
}
|
||||
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);
|
||||
|
|
|
@ -1164,9 +1164,13 @@ class CakeResponse {
|
|||
$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)) {
|
||||
|
|
|
@ -95,6 +95,7 @@ abstract class ObjectCollection {
|
|||
if (empty($this->_enabled)) {
|
||||
return true;
|
||||
}
|
||||
$subject = null;
|
||||
if ($callback instanceof CakeEvent) {
|
||||
$event = $callback;
|
||||
if (is_array($event->data)) {
|
||||
|
|
|
@ -1060,6 +1060,8 @@ class FormHelper extends AppHelper {
|
|||
if ($options['type'] === 'radio' && isset($options['options'])) {
|
||||
$radioOptions = (array)$options['options'];
|
||||
unset($options['options']);
|
||||
} else {
|
||||
$radioOptions = [];
|
||||
}
|
||||
|
||||
$label = $this->_getLabel($fieldName, $options);
|
||||
|
@ -1080,6 +1082,9 @@ class FormHelper extends AppHelper {
|
|||
$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'];
|
||||
|
|
Loading…
Reference in a new issue