ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Any IsValidLink() ? (https://www.esoui.com/forums/showthread.php?t=1111)

Fathis Ules 04/23/14 07:03 AM

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 ????

Stormknight 04/23/14 07:38 AM

What does the "|h" do in text? Not seen that one (that I recall).

Fathis Ules 04/23/14 08:08 AM

|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


Halja 04/23/14 08:10 AM

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

Fathis Ules 04/23/14 08:27 AM

Quote:

Originally Posted by Halja (Post 5504)
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

ins 04/23/14 10:13 AM

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.

Iyanga 04/23/14 05:04 PM

Quote:

Originally Posted by Halja (Post 5504)
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.

Vuelhering 04/23/14 08:12 PM

Quote:

Originally Posted by Iyanga (Post 5564)
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.

Seerah 04/23/14 10:44 PM

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. ;)


All times are GMT -6. The time now is 04:44 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI