Ignore:
Timestamp:
Feb 20, 2014 3:03:59 AM (10 years ago)
Author:
anonymous
Message:

Completed integrating /branches/eli_branch into /trunk. Changes include:

  • Removed closing ?> from end of files
  • Upgrade old-style contructor methods to use construct() instead.
  • Class properties and methods defined as public, private, static or protected
  • Ensure code runs under E_ALL with only mysql_* deprecated warnings
  • Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
  • Run the php cli -l option to check files for syntax errors.
  • Bring tests up-to-date with latest version and methods of PHPUnit
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lib/Captcha.inc.php

    r396 r468  
    5454class Captcha {
    5555
    56     var $secret_key = 'some random seed text for the md5';
    57     var $random_number;
    58     var $ascii_numbers = array(
     56    public $secret_key = 'some random seed text for the md5';
     57    public $random_number;
     58    public $ascii_numbers = array(
    5959        array(
    6060            '  #####   ',
     
    147147     * @since   20 Jan 2006 13:08:22
    148148     */
    149     function Captcha()
     149    public function __construct()
    150150    {
    151151        $app =& App::getInstance();
     
    164164     * @since   07 Dec 2005 21:59:25
    165165     */
    166     function getAsciiNumber($num=null)
     166    public function getAsciiNumber($num=null)
    167167    {
    168168        $app =& App::getInstance();
     
    200200     * @since   07 Dec 2005 22:09:04
    201201     */
    202     function printAsciiNumber()
     202    public function printAsciiNumber()
    203203    {
    204204        $ascii = $this->getAsciiNumber($this->random_number);
     
    213213     * @since   07 Dec 2005 22:09:04
    214214     */
    215     function printForm()
     215    public function printForm()
    216216    {
    217217        $hash = $this->_getMD5key($this->random_number);
     
    231231     * @since   07 Dec 2005 22:19:33
    232232     */
    233     function valid()
     233    public function valid()
    234234    {
    235235        $number = getFormData('sc-captcha-input');
     
    251251     * @since   07 Dec 2005 21:40:25
    252252     */
    253     function _getRandomNumber()
     253    public function _getRandomNumber()
    254254    {
    255255        return mb_substr(strval(rand(10000, 99999)), 0, rand(3, 5));
     
    265265     * @since   07 Dec 2005 21:53:35
    266266     */
    267     function _getMD5key($input)
     267    public function _getMD5key($input)
    268268    {
    269269        return md5($this->secret_key . $input);
     
    272272}
    273273
    274 ?>
Note: See TracChangeset for help on using the changeset viewer.