forgot one function in Froxlor\PhpHelper

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-24 14:04:52 +01:00
parent 7416a41a42
commit 684130871b
2 changed files with 5 additions and 5 deletions

View File

@@ -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)) {

View File

@@ -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);
}