forgot one function in Froxlor\PhpHelper
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -24,7 +24,7 @@ class PhpHelper
|
||||
{
|
||||
if (is_array($subject)) {
|
||||
if (! is_array($fields)) {
|
||||
$fields = self::array_trim(explode(' ', $fields));
|
||||
$fields = self::arrayTrim(explode(' ', $fields));
|
||||
}
|
||||
|
||||
foreach ($subject as $field => $value) {
|
||||
@@ -58,7 +58,7 @@ class PhpHelper
|
||||
public static function strReplaceArray($search, $replace, $subject, $fields = '')
|
||||
{
|
||||
if (is_array($subject)) {
|
||||
$fields = self::array_trim(explode(' ', $fields));
|
||||
$fields = self::arrayTrim(explode(' ', $fields));
|
||||
foreach ($subject as $field => $value) {
|
||||
if ((! is_array($fields) || empty($fields)) || (is_array($fields) && ! empty($fields) && in_array($field, $fields))) {
|
||||
$subject[$field] = str_replace($search, $replace, $subject[$field]);
|
||||
@@ -339,7 +339,7 @@ class PhpHelper
|
||||
* The array to trim
|
||||
* @return array The trim'med array
|
||||
*/
|
||||
public static function array_trim($source)
|
||||
public static function arrayTrim($source)
|
||||
{
|
||||
$returnval = array();
|
||||
if (is_array($source)) {
|
||||
|
||||
@@ -259,7 +259,7 @@ class Store
|
||||
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'ipaddress') {
|
||||
$mysql_access_host_array = array_map('trim', explode(',', Settings::Get('system.mysql_access_host')));
|
||||
$mysql_access_host_array[] = $newfieldvalue;
|
||||
$mysql_access_host_array = array_unique(\Froxlor\PhpHelper::array_trim($mysql_access_host_array));
|
||||
$mysql_access_host_array = array_unique(\Froxlor\PhpHelper::arrayTrim($mysql_access_host_array));
|
||||
$mysql_access_host = implode(',', $mysql_access_host_array);
|
||||
\Froxlor\Database\DbManager::correctMysqlUsers($mysql_access_host_array);
|
||||
Settings::Set('system.mysql_access_host', $mysql_access_host);
|
||||
@@ -289,7 +289,7 @@ class Store
|
||||
'cleanMySQLAccessHost'
|
||||
), $mysql_access_host_array);
|
||||
|
||||
$mysql_access_host_array = array_unique(\Froxlor\PhpHelper::array_trim($mysql_access_host_array));
|
||||
$mysql_access_host_array = array_unique(\Froxlor\PhpHelper::arrayTrim($mysql_access_host_array));
|
||||
$newfieldvalue = implode(',', $mysql_access_host_array);
|
||||
\Froxlor\Database\DbManager::correctMysqlUsers($mysql_access_host_array);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user