1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 09:14:58 +02:00
This commit is contained in:
Ryan Cramer
2023-02-14 09:28:03 -05:00
parent ff1ba95e37
commit c3b9c72df9
3 changed files with 5 additions and 4 deletions

View File

@@ -1561,7 +1561,7 @@ class WireDatabasePDO extends Wire implements WireDatabase {
if($this->stripMB4 && is_string($str) && !empty($str)) { if($this->stripMB4 && is_string($str) && !empty($str)) {
$str = $this->wire()->sanitizer->removeMB4($str); $str = $this->wire()->sanitizer->removeMB4($str);
} }
return $this->pdoLast()->quote($str); return $this->pdoLast()->quote((string) $str);
} }
/** /**

View File

@@ -368,6 +368,7 @@ class WireInput extends Wire {
$this->cookieVars = $this->wire(new WireInputDataCookie($_COOKIE, $this->lazy)); $this->cookieVars = $this->wire(new WireInputDataCookie($_COOKIE, $this->lazy));
$this->cookieVars->init(); $this->cookieVars->init();
} }
$key = (string) $key;
if(!strlen($key)) return $this->cookieVars; if(!strlen($key)) return $this->cookieVars;
if($valid === null && $fallback === null && !strpos($key, '[]')) return $this->cookieVars->get($key); if($valid === null && $fallback === null && !strpos($key, '[]')) return $this->cookieVars->get($key);
return $this->getValidInputValue($this->cookieVars, $key, $valid, $fallback); return $this->getValidInputValue($this->cookieVars, $key, $valid, $fallback);

View File

@@ -74,10 +74,10 @@ class InputfieldInteger extends Inputfield {
} }
} }
if(!strlen($attrs['value'])) { if(!strlen("$attrs[value]")) {
if(strlen($this->initValue)) { if(strlen("$this->initValue")) {
$attrs['value'] = (int) $this->initValue; // Inputfield-only version $attrs['value'] = (int) $this->initValue; // Inputfield-only version
} else if(strlen($this->defaultValue)) { } else if(strlen("$this->defaultValue")) {
$attrs['value'] = (int) $this->defaultValue; // Fieldtype version $attrs['value'] = (int) $this->defaultValue; // Fieldtype version
} }
} }