From 98fc394eb350d55c1876ffe8ce02260113af1368 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 2 Jul 2006 21:42:54 +0000 Subject: - fixed language pack management a bit (supporting backslashes) - fixed ftp_fsock, also fixing a reported bug in there git-svn-id: file:///svn/phpbb/trunk@6139 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4f62fa3100..86f002d14e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2072,26 +2072,41 @@ function extension_allowed($forum_id, $extension, &$extensions) // Little helpers +/** +* Little helper for the build_hidden_fields function +*/ +function _build_hidden_fields($key, $value, $specialchar) +{ + $hidden_fields = ''; + + if (!is_array($value)) + { + $key = ($specialchar) ? htmlspecialchars($key) : $key; + $value = ($specialchar) ? htmlspecialchars($value) : $value; + + $hidden_fields .= '' . "\n"; + } + else + { + foreach ($value as $_key => $_value) + { + $hidden_fields .= _build_hidden_fields($key . '[' . $_key . ']', $_value, $specialchar); + } + } + + return $hidden_fields; +} + /** * Build simple hidden fields from array */ -function build_hidden_fields($field_ary) +function build_hidden_fields($field_ary, $specialchar = false) { $s_hidden_fields = ''; foreach ($field_ary as $name => $vars) { - if (is_array($vars)) - { - foreach ($vars as $key => $value) - { - $s_hidden_fields .= ''; - } - } - else - { - $s_hidden_fields .= ''; - } + $s_hidden_fields .= _build_hidden_fields($name, $vars, $specialchar); } return $s_hidden_fields; -- cgit v1.2.1