Results 1 to 2 of 2
  1.    #1  
    On my TouchPad, I noticed when someone messages me with a message like <b>message</b> it appears in bold, however other tags get stripped.
    I investigated and tried to fix it by editing the enyo removeHtml function and the messaging app.
    Then I stumbled accross the following thing in their own JSJSJS $Unit$ $tests$

    /* the following message text won't happen for libpurple transport yet since the sanitize routine will take out any characters start$
                            expect('I <3 u').toEqual(dashboardMgr.getDisplayText({_kind: 'com.palm.immessage.libpurple:1', messageText: 'I &lt;3 u'}));
                            expect('1<2').toEqual(dashboardMgr.getDisplayText({_kind: 'com.palm.immessage.libpurple:1', messageText: '1&lt;2'}));
                            expect('1 < 2 && 3 > 2').toEqual(dashboardMgr.getDisplayText({_kind: 'com.palm.immessage.libpurple:1', messageText: '1 &lt; 2 &amp;&$
    Looks like someone was being lazy in their unit tests.
    Can anyone point me in a direction on how to fix this. Its quite annoying when someone like makes a ">.<" emoticon and then types their message as it makes the whole rest of their message disappear on Skype and all others.
    Last edited by Doridian; 10/19/2011 at 11:19 PM.
  2.    #2  
    From IMMessage.cpp of imlibpurpletransport

    // allowable html tags to be ignored by the sanitizer
    const char* IMMessage::trustedTags[] = {"b", "/b", "i", "/i", "br", "/br", "u", "/u", "B", "/B", "I", "/I", "BR", "/BR", "U", "/U",NULL};
    //just for testing
    //const char* IMMessage::trustedTags[] = {"b", "/b", "i", "/i", "br", "/br", "u", "/u", "B", "/B", "I", "/I", "BR", "/BR", "U", "/U", "body", "/body", NULL};
    // now remove offending html
    	// char * sanitizeHtml(const char *input, char **except, bool remove);
    	//     remove set to true if you want the the tags to actually be removed vs just "escaped".
    	//     except is an array of char* containing tags to ignore when sanitizing. The
    	//          last element must be a null. You need to include both beginning and ending
    	//          tag if you want both removed (i.e. "b", "/b", "i", "/i")
    	char *sanitizedMessage = sanitizeHtml(unescapedMessage, (char**)IMMessage::trustedTags, true);
    Which is apparently defined in "sanitize.h" which I cannot seem to find anywhere (I would like to patch the actual library that uses to make it just force the last argument to false, library patching needed due to skypem not being open-source for obvious reasons but using the same library function).

Posting Permissions