Skip to content

Commit

Permalink
forgot one function in Froxlor\PhpHelper
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Dec 24, 2018
1 parent 7416a41 commit 6841308
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/Froxlor/PhpHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static function htmlentitiesArray($subject, $fields = '', $quote_style =
{
if (is_array($subject)) {
if (! is_array($fields)) {
$fields = self::array_trim(explode(' ', $fields));
$fields = self::arrayTrim(explode(' ', $fields));
}

foreach ($subject as $field => $value) {
Expand Down Expand Up @@ -58,7 +58,7 @@ public static function htmlentitiesArray($subject, $fields = '', $quote_style =
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]);
Expand Down Expand Up @@ -339,7 +339,7 @@ public static function replaceVariables($text, $vars)
* 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)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Froxlor/Settings/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public static function storeSettingIpAddress($fieldname, $fielddata, $newfieldva
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);
Expand Down Expand Up @@ -289,7 +289,7 @@ public static function storeSettingMysqlAccessHost($fieldname, $fielddata, $newf
'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);
}
Expand Down

0 comments on commit 6841308

Please sign in to comment.