mirror of
https://github.com/dg/dibi.git
synced 2025-07-31 19:30:30 +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) {
|
||||
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
|
||||
$nm = $nm[1];
|
||||
}
|
||||
if ($nm == '') {
|
||||
throw new InvalidStateException('Missing identifier name.');
|
||||
}
|
||||
return $this->$nm = call_user_func($this->getCallback(), $nm);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user