From: <var...@us...> - 2012-01-03 11:38:16
|
Revision: 8217 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8217&view=rev Author: vargenau Date: 2012-01-03 11:38:06 +0000 (Tue, 03 Jan 2012) Log Message: ----------- Fix Captcha problem reported by Harold Hallikainen Modified Paths: -------------- trunk/lib/Captcha.php Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2012-01-03 10:58:12 UTC (rev 8216) +++ trunk/lib/Captcha.php 2012-01-03 11:38:06 UTC (rev 8217) @@ -35,8 +35,8 @@ function captchaword() { if ( ! $this->request->getSessionVar('captchaword')) { - $this->request->setSessionVar('captchaword', $this->get_word()); - } + $this->request->setSessionVar('captchaword', $this->get_word()); + } return $this->request->getSessionVar('captchaword'); } @@ -64,8 +64,9 @@ 'size' => $this->length + 2, 'maxlength' => 256)); $url = WikiURL("", array("action"=>"captcha","id"=>time()), false); - $el['CAPTCHA_IMAGE'] = "<img src=\"$url\" alt=\"captcha\" />"; - $el['CAPTCHA_LABEL'] = '<label for="edit-captcha_input">'._("Type word above:").' </label>'; + $el['CAPTCHA_IMAGE'] = HTML::img(array('src' => $url, 'alt' => 'captcha')); + $el['CAPTCHA_LABEL'] = HTML::label(array('for' => 'edit-captcha_input'), + _("Type word above:")); } return $el; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-21 14:13:36
|
Revision: 8517 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8517&view=rev Author: vargenau Date: 2012-11-21 14:13:25 +0000 (Wed, 21 Nov 2012) Log Message: ----------- Initialize variable Modified Paths: -------------- trunk/lib/Captcha.php Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2012-11-21 14:06:13 UTC (rev 8516) +++ trunk/lib/Captcha.php 2012-11-21 14:13:25 UTC (rev 8517) @@ -147,6 +147,7 @@ $y = rand(50, $height - 20); //50-60 // randomize the chars + $angle = 0; for ($i = 0; $i < strlen($word); $i++) { $angle += rand(-5, 5); if ($angle > 25) $angle = 15; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-17 14:48:35
|
Revision: 9315 http://sourceforge.net/p/phpwiki/code/9315 Author: vargenau Date: 2014-11-17 14:48:27 +0000 (Mon, 17 Nov 2014) Log Message: ----------- Add class variables; add this Modified Paths: -------------- trunk/lib/Captcha.php Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2014-11-17 14:36:57 UTC (rev 9314) +++ trunk/lib/Captcha.php 2014-11-17 14:48:27 UTC (rev 9315) @@ -24,6 +24,15 @@ class Captcha { + public $meta; + public $width; + public $height; + public $length; + public $failed_msg; + /** + * @var WikiRequest + */ + public $request; function Captcha($meta = array(), $width = 250, $height = 80) { @@ -80,7 +89,7 @@ function get_word() { if (USE_CAPTCHA_RANDOM_WORD) - return get_dictionary_word(); + return $this->get_dictionary_word(); else return rand_ascii_readable($this->length); // lib/stdlib.php } @@ -89,6 +98,7 @@ { // Load In the Word List $fp = fopen(findfile("lib/captcha/dictionary"), "r"); + $text = array(); while (!feof($fp)) $text[] = trim(fgets($fp, 1024)); fclose($fp); @@ -99,6 +109,7 @@ $x = mt_rand(0, count($text)); return $text[$x]; } + return ''; } // Draw the Spiral This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |