mirror of
https://github.com/dg/dibi.git
synced 2025-08-03 04:37:35 +02:00
DibiLazyStorage: empty string as property name throws exception; fixed in DibiDatabaseInfo too
This commit is contained in:
@@ -533,7 +533,7 @@ class DibiColumnInfo extends DibiObject
|
|||||||
if (self::$types === NULL) {
|
if (self::$types === NULL) {
|
||||||
self::$types = new DibiLazyStorage(array(__CLASS__, 'detectType'));
|
self::$types = new DibiLazyStorage(array(__CLASS__, 'detectType'));
|
||||||
}
|
}
|
||||||
return self::$types->{$this->info['nativetype']};
|
return $this->info['nativetype'] ? self::$types->{$this->info['nativetype']} : dibi::TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -59,6 +59,9 @@ final class DibiLazyStorage extends DibiLazyStorageBase
|
|||||||
if (is_array($nm)) { // preg_replace_callback support
|
if (is_array($nm)) { // preg_replace_callback support
|
||||||
$nm = $nm[1];
|
$nm = $nm[1];
|
||||||
}
|
}
|
||||||
|
if ($nm == '') {
|
||||||
|
throw new InvalidStateException('Missing identifier name.');
|
||||||
|
}
|
||||||
return $this->$nm = call_user_func($this->getCallback(), $nm);
|
return $this->$nm = call_user_func($this->getCallback(), $nm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user