News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[4902] Text disappearing with SSI.php

Started by Daegaladh, December 05, 2011, 11:31:07 PM

Previous topic - Next topic

Daegaladh

Hi, I'm integrating SSI in a game control panel to get the news from my forum with ssi_boardNews, all works fine, except this:

Text printed via $news dissappears when have special characters like ¿¡áéíóú

For example, the title of one of the news is "aaaa", it works fine. The title of another one is "¿aa?", and isn't showing.
The same happens with some paragraphs on $news['body'], if a paragraph have an special character, it disappears, but not the rest.

The charset of the site is set to UTF-8, as well as my forums, and all the files are encoded in UTF-8 without BOM.

I've tested things like: ñññ<a href="', $news['href'], '">', $news['subject'], '</a>
and the ñññ is showing correctly, but the text from $news['subject'] is still missing, so I think is an SSI problem...

Any ideas? :S
Thanks

emanuele

Confirmed.

The problem seems to be that is not sent the proper header.
Adding a line like:
header('Content-Type: text/html; charset=' . (empty($modSettings['global_character_set']) ? (empty($txt['lang_character_set']) ? 'ISO-8859-1' : $txt['lang_character_set']) : $modSettings['global_character_set']));
somewhere after reloadSettings(); should fix it.

The same applies to subscriptions.php (reported few days ago in the Italian board) in particular when:
if (empty($_POST))
die($txt['paid_no_data']);


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

emanuele

commit b1476c718b18c26a19a11a67944ee386c02d8359
Author: emanuele
Date:   Sun Aug 19

    Fixed a couple of encoding-related issues in SSI.php and subscriptions.php - Thanks Daegaladh and darbula for the reports


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: