DbUserGroupBackend: Use is_numeric() instead of is_int()

Using MySQL fetchColumn() returns integers for id fields, using MariaDB
though, fetchColumn() returns strings..

fixes #9572
This commit is contained in:
Johannes Meyer 2015-07-07 14:07:55 +02:00
parent 604ef87de8
commit f5089dab1a

View File

@ -229,12 +229,12 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa
*/ */
protected function persistGroupId($groupName) protected function persistGroupId($groupName)
{ {
if (! $groupName || empty($groupName) || is_int($groupName)) { if (! $groupName || empty($groupName) || is_numeric($groupName)) {
return $groupName; return $groupName;
} }
if (is_array($groupName)) { if (is_array($groupName)) {
if (is_int($groupName[0])) { if (is_numeric($groupName[0])) {
return $groupName; // In case the array contains mixed types... return $groupName; // In case the array contains mixed types...
} }