succo
10-01-2006, 02:27 PM
i'm trying to use a custom form to submit a thread/reply to one of my forums from outside the vbulletin installment (properly, within a vbadvanced module), but have great troubles in submitting 'special characters' like the italian accented letters (?????)
i guess it must be related with a function defined in the php file, which is
function htmlspecialchars_decode($string, $type=ENT_QUOTES)
{
$array = array_flip(get_html_translation_table(HTML_SPECIAL CHARS, $type));
return strtr($string, $array);
}
and which is used just before submitting the message to the dm_threadpost, like this
// finally, set up the important stuff
$blog['title'] = htmlspecialchars_decode($vbulletin->GPC['title']);
$blog['message'] = htmlspecialchars_decode($vbulletin->GPC['message']);
i guess that must be the point, as there are other recurrency of that function in the code, but regarding re-submitting the form, like
// recover the fields we need that are normally taken care of when
// running as a module within vBa and then display the popup again
$mod_options = $blog_options;
$blog['bid'] = $vbulletin->GPC['bid'];
$blog['postername'] = htmlspecialchars_decode($vbulletin->GPC['name']);
$blog['title'] = htmlspecialchars_decode($vbulletin->GPC['title']);
$blog['msg'] = htmlspecialchars_decode($vbulletin->GPC['message']);
$blog['ident'] = htmlspecialchars_decode($vbulletin->GPC['identifier']);
and in case of error
// prepare all the data to be carried forward in the error message
$blog['bid'] = $vbulletin->GPC['bid'];
$blog['postername'] = htmlspecialchars($vbulletin->GPC['name']);
$blog['title'] = htmlspecialchars($vbulletin->GPC['title']);
$blog['msg'] = htmlspecialchars($vbulletin->GPC['message']);
$blog['ident'] = htmlspecialchars($vbulletin->GPC['identifier']);
(but here it's the standard htmlspecialchars() which is used)
could someone please help in submitting the form as it must be?
thanks
p.s. this thread has been submitted to vbulletin.com, and they told me to submit it here :)
i guess it must be related with a function defined in the php file, which is
function htmlspecialchars_decode($string, $type=ENT_QUOTES)
{
$array = array_flip(get_html_translation_table(HTML_SPECIAL CHARS, $type));
return strtr($string, $array);
}
and which is used just before submitting the message to the dm_threadpost, like this
// finally, set up the important stuff
$blog['title'] = htmlspecialchars_decode($vbulletin->GPC['title']);
$blog['message'] = htmlspecialchars_decode($vbulletin->GPC['message']);
i guess that must be the point, as there are other recurrency of that function in the code, but regarding re-submitting the form, like
// recover the fields we need that are normally taken care of when
// running as a module within vBa and then display the popup again
$mod_options = $blog_options;
$blog['bid'] = $vbulletin->GPC['bid'];
$blog['postername'] = htmlspecialchars_decode($vbulletin->GPC['name']);
$blog['title'] = htmlspecialchars_decode($vbulletin->GPC['title']);
$blog['msg'] = htmlspecialchars_decode($vbulletin->GPC['message']);
$blog['ident'] = htmlspecialchars_decode($vbulletin->GPC['identifier']);
and in case of error
// prepare all the data to be carried forward in the error message
$blog['bid'] = $vbulletin->GPC['bid'];
$blog['postername'] = htmlspecialchars($vbulletin->GPC['name']);
$blog['title'] = htmlspecialchars($vbulletin->GPC['title']);
$blog['msg'] = htmlspecialchars($vbulletin->GPC['message']);
$blog['ident'] = htmlspecialchars($vbulletin->GPC['identifier']);
(but here it's the standard htmlspecialchars() which is used)
could someone please help in submitting the form as it must be?
thanks
p.s. this thread has been submitted to vbulletin.com, and they told me to submit it here :)