Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
953 views
in Plugins by

 

http://3.bp.blogspot.com/-_ZPZhAdN7Vo/UHaS1c21AmI/AAAAAAAAfwQ/F7eqcf5DFXU/s1600/abcdef123456.gif ==>> display image

 

http://3.bp.blogspot.com/-_ZPZhAdN7Vo/UHaS1c21AmI/AAAAAAAAfwQ/F7eqcf5DFXU/s1600/abcdef+123456.gif ==> not working, just display image link

Can you fix that ?

Can anyone fix that ?

Thanks.

2 Answers

0 votes
by

In qa-embed-layer.php go to line 52:

'image'=>array('(https*:\/\/[-\%_\/.a-zA-Z0-9]+\.(png|jpg|jpeg|gif|bmp))[^< ]*','<img src="$1" style="max-width:'.$w2.'px;max-height:'.$h2.'px" />','img'),

This is "parsing" the link to an image html tag.

As you can see there is no \+ sign in the regex. I am not 100 % sure, but just try to add it:

'image'=>array('(https*:\/\/[-\%_\/.a-zA-Z0-9\+]+\.(png|jpg|jpeg|gif|bmp))[^< ]*','<img src="$1" style="max-width:'.$w2.'px;max-height:'.$h2.'px" />','img'),

Does it work for you?

by
Thanks so much,  @echteinfachtv (Kai)
I tried but still not working
image url include + ( ) not working too
by
As NoahY wrote below, just update the plugin, there is the new correct regex with: '(https*:\/\/[-\%_\/.a-zA-Z0-9+]+\.(png|jpg|jpeg|gif|bmp))[^< ]*'

You see, the \ in front of + in my answer is too much :)

Link to plugin: https://github.com/NoahY/q2a-embed
0 votes
by
I just added a plus symbol to the regex (no need to escape it).  Should work in latest code, but I'm not sure that urls are supposed to have + symbols...
...