Regex

teletubbi

Well-known member
Hi,
i have Members who have picture links in their posts.
These pictures are hosted extern.

Since we had some problems with external hosters in the past (they disappeared, change rules and so on) we switched to Andys Addon convert pictures to host them by ourself. This will keep the threads readable.
It is nothing more boring than to have a nice travel story where all pictures are gone.

Now my problem.
Links are like this.
Code:
[IMG alt="[Bild: xxxxx.jpg]"]https://i.postimg.cc/xxxxx/xxxxx.jpg[/IMG]

The part alt="[Bild: xxxxx.jpg]" keeps Andys Addon from working.
I don't really know where this part come from. The original links from the hoster don't have it.
He post this story at another forum as well and copy it from there to us.
So my guess is the other forum software put it there or xenforo do.

How can i avoid this part?
If it comes from the other software is there a possibility to use a regex expression at censoring?
I installed already the addon for this but can't get it to work. Any hint for a working regex are warmly welcome.

Or if it comes from xenforo itself any hint where i can find this piece of code will help me also.
 
I am still looking for other solutions beside changing the addon.
That's the regex used in the addon. ("/\[IMG(.*?)\](.+?)\[\/IMG\]/i", $currentMessage, $out))

It is fine that some might know the solution but it doesn't help me in any way if the answers are only without any concrete hint.
 
I am still looking for other solutions beside changing the addon.
That's the regex used in the addon. ("/\[IMG(.*?)\](.+?)\[\/IMG\]/i", $currentMessage, $out))

It is fine that some might know the solution but it doesn't help me in any way if the answers are only without any concrete hint.

Why not use the inbuilt image proxy?
 
Top Bottom