Page 1 of 1

J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 23 Jul 2012, 15:33
by Kharlanki
Hi,

J!2.5.6
PHP 5.3.14
phoca GuestBook 2.0.5

If I switch from PHP 5.2.17 to 5.3.x I'll get no TTF Captcha. If I browse manually to the mage URL, I get this error:

Code: Select all

Warning: mt_rand() [function.mt-rand]: max(50) is smaller than min(52) in /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php on line 82

Warning: mt_rand() [function.mt-rand]: max(125) is smaller than min(126) in /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php on line 82

Warning: mt_rand() [function.mt-rand]: max(162) is smaller than min(163) in /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php on line 82

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php:82) in /home/xxx/components/com_phocaguestbook/views/guestbooki/tmpl/default.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php:82) in /home/xxx/components/com_phocaguestbook/views/guestbooki/tmpl/default.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php:82) in /xxx/components/com_phocaguestbook/views/guestbooki/tmpl/default.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php:82) in /home/xxx/components/com_phocaguestbook/views/guestbooki/tmpl/default.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php:82) in /home/xxx/components/com_phocaguestbook/views/guestbooki/tmpl/default.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/components/com_phocaguestbook/helpers/phocaguestbookcaptcha.php:82) in /home/xxx/components/com_phocaguestbook/views/guestbooki/tmpl/default.php on line 8
With PHP 5.2.17 or 5.4.14 it works fine...

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 26 Jul 2012, 13:20
by Jan
Hi, will do some tests.

Please try to do this:

Go to file components\com_phocaguestbook\helpers\phocaguestbookcaptcha.php

and replace this function (cca line 79)

FROM:

Code: Select all

function getRandomPositionX($i) {
		$rand_2 = mt_rand(-2,3);
		$rand_3 = $i + ($rand_2);
		$rand 	= mt_rand($i,$rand_3);
		return $rand;
	}
TO:

Code: Select all

function getRandomPositionX($i) {
		$rand_2 = mt_rand(-2,3);
		$rand_3 = $i + ($rand_2);
		
		if ((int)$i > $rand_3) {
			$rand 	= mt_rand($rand_3, $i);
		} else {
			$rand 	= mt_rand($i,$rand_3);
		}
		return $rand;
	}
and let me know.

Thank you, Jan
Jan

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 26 Jul 2012, 13:39
by Kharlanki
Yay, that works! :)

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 26 Jul 2012, 23:10
by Jan
Great to hear it, I will set it for next release.

Jan

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 14 Aug 2012, 22:24
by ChOpSueY!
This is not working to me Jan, still the problems.

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 17 Aug 2012, 11:18
by ChOpSueY!
Hey Jan,
can I expect any help for this? I need to figure it out or else i have to search for alternatives. The guestbook has no funtion like this. Hope you can help.

Best regards,

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 25 Aug 2012, 15:18
by Jan
Hi, testing now without any problem, do you get some error message after making the change? (listed above)?

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 28 Aug 2012, 14:03
by ChOpSueY!
Hi Jan,
it simply has no effect. I have altered it the way you said in your post above. There is still no captcha, simply "Sicherheitsabfrage". The error massage when you try to view the captcha is:

Fatal error: Call to a member function get() on a non-object in D:\FTP_Root\LocalUser\usr_helmscheid\components\com_phocaguestbook\views\guestbooki\tmpl\default.php on line 37

Best regards,
Martin

Re: J!2.5.6 + PHP 5.3.14 + GB 2.0.5 = no TTF Captcha

Posted: 19 Sep 2012, 00:09
by Jan
Hi, really not sure what did you modify there, but in original there is no such line :-( :idea:

Jan