Also make sure type is correct for preg_match
parent
832f4007d6
commit
4842f213a1
|
@ -326,7 +326,7 @@ class ValidatingArrayLoader implements LoaderInterface
|
||||||
if (isset($this->config[$srcType]['reference']) && !is_string($this->config[$srcType]['reference']) && !is_int($this->config[$srcType]['reference'])) {
|
if (isset($this->config[$srcType]['reference']) && !is_string($this->config[$srcType]['reference']) && !is_int($this->config[$srcType]['reference'])) {
|
||||||
$this->errors[] = $srcType . '.reference : should be a string or int, '.gettype($this->config[$srcType]['reference']).' given';
|
$this->errors[] = $srcType . '.reference : should be a string or int, '.gettype($this->config[$srcType]['reference']).' given';
|
||||||
}
|
}
|
||||||
if (isset($this->config[$srcType]['reference']) && preg_match('{^\s*-}', $this->config[$srcType]['reference'])) {
|
if (isset($this->config[$srcType]['reference']) && preg_match('{^\s*-}', (string) $this->config[$srcType]['reference'])) {
|
||||||
$this->errors[] = $srcType . '.reference : must not start with a "-", "'.$this->config[$srcType]['reference'].'" given';
|
$this->errors[] = $srcType . '.reference : must not start with a "-", "'.$this->config[$srcType]['reference'].'" given';
|
||||||
}
|
}
|
||||||
if (preg_match('{^\s*-}', $this->config[$srcType]['url'])) {
|
if (preg_match('{^\s*-}', $this->config[$srcType]['url'])) {
|
||||||
|
|
Loading…
Reference in New Issue