HTML tags are visible

mpahic's Avatar

mpahic

05 Aug, 2009 03:56 PM via

The trouble is that the tags are visible on Gtalk/Jabber. Even the line breaks. Here is what I got (the text is the same as the server output).

Š�?ČĆŽšđ�?ćž<br>Š�?ČĆŽšđ�?ćž<br> *bold* <br> <strong>strong</strong> <br> _italic_ <br> -strike- <a href="google.com">Gugl</a>

As for the MSN the line breaks are ok and this is what I got:
Š�?ČĆŽšđ�?ćž
Š�?ČĆŽšđ�?ćž
*bold*
<strong>strong</strong>
_italic_
-strike-
<a href="google.com">Gugl</a>

  1. 2 Posted by mpahic on 09 Aug, 2009 05:02 PM

    mpahic's Avatar

    Am I the only one with this problem? It has almost passed a week since I have this prob, and nobody answered if this is being fixed or not. Do I have to use some other formatting for the text?

  2. 3 Posted by gaute on 09 Aug, 2009 05:13 PM

    gaute's Avatar

    Hi,

    No, you are not the only one. I also have this issue with my msn bot. Before the html code was not visible, while now it is. My bot is also in offline mode. No ideas why. It has been like this for weeks now.

  3. 4 Posted by Dave Hoff on 10 Aug, 2009 04:08 PM

    Dave Hoff's Avatar

    You shouldn't see html in your output on gtalk unless the html you're returning is not valid. I see you return
    tags, can you change those to
    and see if the problem still exists?

    Gaute, please start a new private discussion and send us your bot.im and msn screen names so we can look into it.

  4. 5 Posted by mpahic on 10 Aug, 2009 07:26 PM

    mpahic's Avatar

    Change to what? Sorry I guess part of the message seems to be missing.
    As for the test, I've been using this test message for ages and it suddenly started to show the tags.

  5. 6 Posted by mpahic on 13 Aug, 2009 09:31 PM

    mpahic's Avatar

    Ok, just found out something strange. I just found out one of my functions returns bolded and breaks correctly in Gtalk. Its code is:

    public function getReplies() {

        try {
    
            if (!$response = $this->twitterObj->get_statusesReplies(array('count' => '10')))
    
                return 'noserver';
        } catch(Exception $e){
            return 'noserver'; 
        }
    
    
    
        foreach ($response as $message) {
            $time = niceTime(strtotime(str_replace("+0000", "", $message->created_at)));
    
            echo "<strong>".$message->user->screen_name.":</strong> ".$message->text." $time <br/>";
        }
    
    
    
        return null;
    

    }

    But the simmilar function in the same class shows the html:
    public function statuses() {

        try {
    
            if (!$response = $this->twitterObj->get_statusesFriends_timeline(array('count' => '10')))
    
                return 'noserver';
        } catch(Exception $e){
            return 'noserver'; 
        }
    
    
        foreach ($response as $message) {
            $time = niceTime(strtotime(str_replace("+0000", "", $message->created_at)));
    
            echo "<strong>".$message->user->screen_name.":</strong> ".$message->text." $time <br/>";
        }
    
        return null;
    
    }`
    

    I don't know why is this happening. I checked the output, which is the same, I tried changing the header encoding, and it is always the same. The first one is ok, and the second one is not. And why did this start happening after your last maintenance? It worked ok before.

  6. Support Staff 7 Posted by Adam Kalsey on 13 Aug, 2009 09:39 PM

    Adam Kalsey's Avatar

    What's the message text in those instances?

    If your text includes invalid XML, we will XML encode it so as not to
    break IM clients. Some IM clients and servers will refuse to deliver
    or display content that contains invalid xml.

    So if your content includes an unclosed HTML tag, ampersands, or bare
    quotes, this could cause this. We do some work to fix some basic XML
    issues before escaping it.

  7. 8 Posted by mpahic on 14 Aug, 2009 09:17 PM

    mpahic's Avatar

    The text returned on the first (correct display) is:
    <strong>z00lle:</strong> @mpahic ti kazem da budem pitao ekipu iz doma 111 dana prije. <br/><strong>z00lle:</strong> @mpahic trazim 3 miljona dolara koje sam jucer izgubio na zeldi :) zezam se budem pito ove iz doma dali neko igra :) 111 dana prije. <br/><strong>z00lle:</strong> @mpahic neznam da su imali besplatne poruke 115 dana prije. <br/><strong>z00lle:</strong> @mpahic a tako se reply-a strava trebalo mi je neko vrjeme da skuzim 116 dana prije. <br/><strong>imified:</strong> @mpahic It looks like an issue with Google Talk. Other Jabber servers are working fine. We're looking into it. Thanks for the heads up. 139 dana prije. <br/><strong>damirdvorscak:</strong> @ mpahic evo i sa et 546 dana prije. <br/><strong>damirdvorscak:</strong> @mpahic porukica... 546 dana prije. <br/><strong>damirdvorscak:</strong> @mpahic neka poruka 546 dana prije. <br/>

    And the return text on the other (which shows html) is:
    <strong>imified:</strong> Like building IMified bots? Want to get paid for it? Someone's posted a gig to build a bot for them. http://ow.ly/jTDp dan prije. <br/><strong>imified:</strong> Nice idea! -&gt; RT @techbangalore Create Always Online IM auto responder using Imified: http://bit.ly/R0X2W 2 dana prije. <br/><strong>imified:</strong> We're experiencing some issues with adding contacts to some networks. Emergency downtime is required. Watch http://status.imified.com/ 7 dana prije. <br/><strong>imified:</strong> Google issues are resolved. If you're unable to connect to your Jabber bot from any Google Talk domain, please let us know. 7 dana prije. <br/><strong>mpahic:</strong> sa 450g manje krvi 8 dana prije. <br/><strong>imified:</strong> We've got a network issue connecting to Google servers. All bots are online but inaccessible to Google Talk. We're investigating. 9 dana prije. <br/><strong>z00lle:</strong> I love the morning rituals with coffee 10 dana prije. <br/><strong>imified:</strong> Scheduled Maintenance Tonight http://ow.ly/iY60 10 dana prije. <br/><strong>mpahic:</strong> dojdem u vz i prvo me docekaju komarci 14 dana prije. <br/><strong>imified:</strong> @matthew_raymer send your imified account username over and we'll enable skype for you 23 dana prije. <br/>

    I checked and the coding is ok. but I don't understand why the same bot on MSN displays this thing correctly.
    PS: I also tried with <br> , same thing, <br> and <strong> are shown.

  8. 9 Posted by mpahic on 17 Aug, 2009 01:48 PM

    mpahic's Avatar

    Ok, found out what the trouble is.
    When the Croatian signs: ŠĐČĆŽšđčćž are present in the message the message shows the html tags.
    Can you now fix this bug?

  9. 10 Posted by mpahic on 18 Aug, 2009 12:21 PM

    mpahic's Avatar

    Thank you. I see you resolved the issue. Also the encoding of the two signs that weren't shown right.
    Thank you.

  10. 11 Posted by mpahic on 19 Aug, 2009 11:36 AM

    mpahic's Avatar

    I found another one :p Please don't hate me.
    On the MSN network the text between <strong> tags disappears completely. Jabber text is ok, it is bolded.

  11. Support Staff 12 Posted by Adam Kalsey on 19 Aug, 2009 03:30 PM

    Adam Kalsey's Avatar

    We don't recommend using HTML or formatting. IM clients are not web
    browsers and provide unpredictable results with HTML. Anything beyond
    a line break tends to break down across IM clients.

  12. 13 Posted by nikola on 08 Sep, 2009 09:42 AM

    nikola's Avatar

    hi,

    how can i insert new line sign? tryed with \n but no results...

    tnx in adv!

  13. 14 Posted by Dave Hoff on 08 Sep, 2009 01:20 PM

    Dave Hoff's Avatar

    A <br/> tag will give you a new line.

  14. 15 Posted by mpahic on 12 Nov, 2009 09:37 AM

    mpahic's Avatar

    This just happened again. I'm guessing one of these signs %&#! is the cause. But only on jabber. It doesn't happen on MSN.

  15. 16 Posted by Dave Hoff on 12 Nov, 2009 01:54 PM

    Dave Hoff's Avatar

    Hi, what specifically happened again?

  16. Support Staff 17 Posted by Adam Kalsey on 12 Nov, 2009 04:19 PM

    Adam Kalsey's Avatar

    Because Jabber uses XML as it's data format, invalid XML in a message
    would result in your message not being delivered. To protect against
    this, we check each message to see if it's valid XML and entity encode
    it if it is not.

    For instance, if you send a message that is `<b>Foo</b>` we'll deliver
    as is, since that's a valid XML fragment. If you send `Bert & Ernie`
    we see the bare ampersand and encode the message, delivering this as
    `Bert &amp; Ernie`. Jabber clients will decode the HTML and display it
    as `Bert & Ernie`.

    What you're seeing is that you have perfectly valid HTML that's being
    entity encoded because you have a stray bare XML character somewhere
    in the message or an unclosed HTML tag. Because we can't determine the
    original meaning of your message and decide which characters should be
    encoded and which should not, we encode the whole message. Make sure
    your HTML tags are all closed and XML entity encode your strings and
    you'll be good.

    XML reserves 5 characters for internal use. These are the five
    characters you'll need to encode to prevent us from doing it for you:
    `& < > " '` (ampersand, both angle brackets, and single and double
    quotes). Encode them as their HTML character entity (`&amp; &lt; &gt;
    &quot; &apos;) to make your strings valid XML.

    Other networks like MSN don't require messages to be valid XML, and
    thus no encoding is necessary.

  17. 18 Posted by mpahic on 13 Nov, 2009 11:39 AM

    mpahic's Avatar

    Hm, I don't know what is the encoding, but the xml is surely valid.
    I pop the xml from twitter, and I only display the message result so it should be ok, but I didn't try parsing the whole message for those unknown signs.
    I thought it breaks like it broke the first time on croatian signs., but will try to parse it.

  18. 19 Posted by mlucas on 15 Oct, 2010 03:06 PM

    mlucas's Avatar

    Sorry for the late response regarding your issue. Is this still an issue that you are currently experiencing? I will be monitoring this page for a reply and I look forward to helping resolve this for you.

    -Matt Lucas
    IMified Support

Reply to this discussion

Internal reply

Formatting help or Preview

Attached Files

You can attach files up to 10MB

What is 4 times four?

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.