Thread Tools Display Modes
04/23/14, 07:03 AM   #1
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
Any IsValidLink() ?

I don't know if you have seen this recently, but in addition to the usual color flooders using "|c" , now gold spammers are using "|h" in game links

Is it any API ingame for a simple check like IsValidLink("|HFF0000:ev|hk|h") returning False ?

Yet the only workaround to test this is to create a hidden Tooltip, use tooltip:SetLink and catch the error message "malformed link" when registering an event to EVENT_LUA_ERROR

There is really no better way for forcing the client to return if the link is valid ????
  Reply With Quote
04/23/14, 07:38 AM   #2
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
What does the "|h" do in text? Not seen that one (that I recall).
  Reply With Quote
04/23/14, 08:08 AM   #3
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
|H marks the start of a hyperlink and |h the end
|c marks the start of a simple text color and |r the end

I ended up using a less costly method if anyone is interested, basically if |H is used, it returns true at the first invalid link detected

Code:
local links_type = { -- Color spammers now uses |H color links, need to check link validity
    [0] = "|H[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]:item:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+:%d+|h%[[^%]]+%]|h", -- ITEM_LINK_TYPE        |H2DC50E:item:30164:1:7:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h[Ancolie]|h
    [1] = "|H[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]:achievement:%d+:%d+:%d+|h%[[^%]]+%]|h",                                                              -- ACHIEVEMENT_LINK_TYPE |HDCD822:achievement:554:65535:1397743073|h[Chasseur d'éclats célestes de Fendretour]|h
    [2] = "|H[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]:book:%d+|h%[[^%]]+%]|h"                                                                              -- BOOK_LINK_TYPE        |HE27A3F:book:156|h[Jorunn le Roi-scalde]|h
}

local function has_invalid_link(text)
    if text:match("|[hH]") then
        for a in text:gmatch("|H.-:.-|h.-|h") do
            local isLinkValid = false
            for i = 0, #links_type do
                if a:match(links_type[i]) then
                    isLinkValid = true
                    break
                end
            end
            if not isLinkValid then
                return true
            end
        end
    end
    return false
end

Last edited by Fathis Ules : 04/23/14 at 08:11 AM.
  Reply With Quote
04/23/14, 08:10 AM   #4
Halja
 
Halja's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 111
Is the |h how sometime a right click ignore is doing nothing?
I was starting to wonder if the gold spammers had found a way to obfuscate their @names.
--halja
  Reply With Quote
04/23/14, 08:27 AM   #5
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
Originally Posted by Halja View Post
Is the |h how sometime a right click ignore is doing nothing?
I was starting to wonder if the gold spammers had found a way to obfuscate their @names.
--halja
Yeah I think they removed some of these hacks I haven't caught one recently but I believe they used some magic char to bug the system, haven't really caught one recently because I do a bayesian antispam not using the ignore list, it hooks message on top of everything to makes simple filterings ala world of warcraft

The |h spam is not really related to this, it is just they are spamming lines like this one

Code:
"W |HFF0000:hg|hW|h    W  . |HFF0000:cy|hM|h    |HFF0000:ur|hM|h O  U U    |HFF0000:ze|h.|h  C  |HFF0000:aq|hO|h M          100  |HFF0000:ev|hk|h    |HFFFF00:hh|h=|h 11.14  EUR"
And |HFF0000:hg| is use to color spam and so on it is not safe to do a simple regular expression removal of |H everywhere because you will modify the legit links, that's why the need to check for a link Invalidity before going into the replacements, that's probably the less costly and easiest method to get ride of color trolls and spammers using |c and |h actually

Last edited by Fathis Ules : 04/23/14 at 08:38 AM.
  Reply With Quote
04/23/14, 10:13 AM   #6
ins
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 76
Is funny when their spam makes their urls nearly unreadable.
I'm waiting for them to use textures myself.
Course, its not only spammers using h and c links in chat anymore.

Hope you get the spam filter updated with all the variants, nice to use it sometimes. Alternatively I just ended up removing zone chat.
  Reply With Quote
04/23/14, 05:04 PM   #7
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Halja View Post
Is the |h how sometime a right click ignore is doing nothing?
I was starting to wonder if the gold spammers had found a way to obfuscate their @names.
--halja

They just add a lot of spaces so the name scrolls out of the window and then put in a fake character link.
As string so to say "____________________________________________[Blurbdid]: Buy my gold!"

You need to scroll upwards to see the real link.
  Reply With Quote
04/23/14, 08:12 PM   #8
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by Iyanga View Post
They just add a lot of spaces so the name scrolls out of the window and then put in a fake character link.
As string so to say "____________________________________________[Blurbdid]: Buy my gold!"

You need to scroll upwards to see the real link.
Yeah, it's something like that, but they are embedding links of real players who end up getting banned

It's closer to:

"I agree (or gibberish) ______________________________________________________ [player link of someone] Zone: guy bold at guy-bold.com!"

and it comes out

[spammer] Zone: I agree
[real player] Zone: guy bold at guy-bold.com!

If you click on [real player], you can report or ignore them since it's a real link.
  Reply With Quote
04/23/14, 10:44 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
People used to do that in WoW to imitate GMs. iirc, WoW changed it so that you couldn't have so many spaces in a row.

Also, if you change the width of the chat frame, it makes these really obvious.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Any IsValidLink() ?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off