By Paul on Thursday, 23 November 2017
Posted in Technical Issues
Replies 4
Likes 0
Views 743
Votes 0
I notice that if a user uses the bbcode button to link to an image and they do what a lot of users do every day and that is to link to an image somewhere that has a complicated URL, like via a cdn or some photo service like photobucket that makes it difficult to actually hotlink an image, that the url will be some variation that doesn't end in a file extension e.g. "http://testsite.com/image.jpg?large.version";

After the user submits their post/reply the post will show with a language error even if the photo link was only part of the content of their post. The error will display as the text of the completed post/reply and it will be like this:

Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 131 in /public_html/administrator/components/com_easydiscuss/includes/string/string.php on line 346


This also happens the same way even if the url is linking to an actual image file like:
"http://testsite.com/image.jpg"
but pehaps they were copying and pasting so they copied and pasted it like:
"tp://testsite.com/image.jpg"
or
"http://testsite.com/image.jp"

The way this error is handled needs to be fixed but even aside from that I would like to make a suggestion on how to help reduce this error from occurring. Two options include:

1) some sort of checking to ensure a properly formed URL that occurs before the post is completed.
2) some sort of fixing such as correcting common issues like: removing anything in a url after an image file like automatically removing anything after .jpg, .png or .jpeg
Thanks for reported, I will lock this into our issue tracker.

By the way, can you try download my temporary fix and see how it goes?

JoomlaFolder/administrator/components/com_easydiscuss/includes/string/string.php
·
Thursday, 23 November 2017 16:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Arlex, thank you for your attention to this. Now is the first time I have had to test this with your temporary fix. When I test using the three scenarios that I mentioned:

1) "http://testsite.com/image.jpg?large.version";;
2) "tp://http://testsite.com/image.jpg";
3) "http://testsite.com/image.jp";

numbers 1 and 3 now don't show the language error but #2 still does.
·
Thursday, 30 November 2017 04:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Try download my attached file and replace into following file path :

JoomlaFolder/administrator/components/com_easydiscuss/includes/string/string.php
JoomlaFolder/administrator/components/com_easydiscuss/includes/parser/parser.php
·
Thursday, 30 November 2017 12:06
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post