Форумы / Cotonti / Extensions / watermark error siena

plugin watermark error siena

elfrenazo
#1 05.01.2012 07:30

hello, error in watermark, images disappear.

Config: datas/users/(.*?)\.(gif|jpeg|jpg|png)

is that correct? I have to put something in htaccess?

Trustmaster
#2 07.01.2012 09:37

That config looks correct. Could you give me some example "src" attribute values for images when watermark is enabled?

May the Source be with you!
elfrenazo
#3 08.01.2012 00:47

Ok

IMG LINE 1

\[img=((?:http://|https://|ftp://)?[^\]"\';:\?]+\.(?:jpg|jpeg|gif|png))\]((?:http://|https://|ftp://)?[^\]"\';:\?]+\.(?:jpg|jpeg|gif|png))\[/img\]


<a href="$1"><img src="$2" alt="" /></a>

 

IMG LINE 2

\[img\]((?:http://|https://|ftp://)?[^"\';:\?\[]+\.(?:jpg|jpeg|gif|png))\[/img\]


<img src="$1" alt="" />

Trustmaster
#4 08.01.2012 08:19

Sorry, I mean "src" of images in the HTML output (result page).

May the Source be with you!
elfrenazo
#5 08.01.2012 08:27
<img src="http://www .malditopc.es/./datas/users//17_1308.jpg" alt="" />
Отредактировано: elfrenazo (14.05.2013 03:51, 10 лет назад)
Trustmaster
#6 08.01.2012 10:06

And how does it look when watermark is enabled?

May the Source be with you!
elfrenazo
#7 08.01.2012 19:38

sorry this is the html output to the selected watermark

<img src="http://www .malditopc.es/./plugins/watermark/lib/watermark.php?path=datas%2Fusers%2F%2F17_1308.jpg" alt="" />
Отредактировано: elfrenazo (14.05.2013 03:51, 10 лет назад)
Trustmaster
#8 09.01.2012 12:02

I see, something is wrong with path detection. Could you open 'plugins/watermark/lib/watermark.php' and replace line 12 with:

echo '<h1>Forbidden</h1>Path: '.$path.'<br/>Realpath: '.$realpath.'<br/>DocRoot: ' . $_SERVER['DOCUMENT_ROOT'];

This will help to find the bug.

May the Source be with you!
elfrenazo
#9 09.01.2012 21:32

change line 9

FALSE / TRUE

if (strpos($realpath, $_SERVER['DOCUMENT_ROOT']) === TRUE || !preg_match('#\.(gif|jpeg|jpg|png)$#i', $path))
ok plugin

yes