--- functions.php Wed Jun 14 19:45:23 2017
+++ functions.php Wed Jun 14 20:11:18 2017
@@ -3915,7 +3915,7 @@
define('NOPMPOPUP', 1); // No footer here
require_once(DIR . '/includes/functions_misc.php');
- $postvars = construct_hidden_var_fields(verify_client_string($vbulletin->GPC['postvars']));
+ $postvars = construct_hidden_var_fields(verify_client_string($vbulletin->GPC['postvars']), true);
$formfile =& $url;
($hook = vBulletinHook::fetch_hook('redirect_generic')) ? eval($hook) : false;
@@ -8318,7 +8318,7 @@
}
}
-function convert_array_utf8($data, $charset = '')
+function convert_array_utf8($data, $charset = '', $fromutf8 = false)
{
$result = array();
@@ -8337,9 +8337,16 @@
}
else
{
- /* Try converting to utf8
+ /* Try converting to or from utf8
//IGNORE tells it to discard any failed characters */
- $result[$name] = iconv($charset, 'UTF-8//IGNORE', $value);
+ if ($fromutf8)
+ {
+ $result[$name] = iconv('UTF-8', $charset . '//IGNORE', $value);
+ }
+ else
+ {
+ $result[$name] = iconv($charset, 'UTF-8//IGNORE', $value);
+ }
}
}
}
--- functions_misc.php Wed Jun 14 19:45:23 2017
+++ functions_misc.php Wed Jun 14 20:29:02 2017
@@ -775,13 +775,14 @@
}
/**
-* Returns a collection of fields containing the values specified in the serialized array provided
+* Returns a collection of fields containing the values specified in the jsoen encoded array provided
*
-* @param string Serialized array of name=value pairs
+* @param string JSON encoded array of name=value pairs
+* @param boolean Convert UTF to current charset
*
* @return string HTML hidden fields
*/
-function construct_hidden_var_fields($serializedarr)
+function construct_hidden_var_fields($serializedarr, $utf8convert)
{
$temp = json_decode($serializedarr, true);
@@ -789,7 +790,12 @@
{
return '';
}
-
+
+ if ($utf8convert)
+ {
+ $temp = convert_array_utf8($temp, '', true);
+ }
+
$html = '';
foreach ($temp AS $key => $val)
{