0 Members and 1 Guest are viewing this topic.

*

raj2200

  • *
  • 18
  • learning coding to know computing power
big in captcha on php 7 fixed
« on: August 23, 2017, 03:29:44 PM »
there is a bug in captcha file because code is written in php 4

old code use method name same as class name IE  function SecurityImage()  and class SecurityImage()

Code: [Select]
class SecurityImage
{
/**
* Constructor, setup initial values.
*
* @return SecurityImage
*/

function SecurityImage()
{

}
}


this canbe fixed by replacing function SecurityImage() with  function __CONSTRUCT()

Code: [Select]
class SecurityImage
{
/**
* Constructor, setup initial values.
*
* @return SecurityImage
*/

function __CONSTRUCT()
{

}
}


now this works with php 7 aswell older php 5

i have attached file in this post in captcha.zip  file extract it and replace  SecurityImage.php  file with file i uploaded in this post 

replaced function SecurityImage() with __CONSTRUCT()

if still problem please report will try to fix again if i made any mistake
Solve The Problem, Write The Code :)

*

Pharg

  • *****
  • 2,886
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: big in captcha on php 7 fixed
« Reply #1 on: August 23, 2017, 10:04:42 PM »
Hi Raj2200,

Thanks for that fix Raj.

I noticed with PHP 7 it has to have __CONSTRUCT() in the code adds more security I hear.

I thought the __CONSTRUCT() was also suppose to have a public function or is that only used in some areas?
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

raj2200

  • *
  • 18
  • learning coding to know computing power
Re: big in captcha on php 7 fixed
« Reply #2 on: August 30, 2017, 04:42:08 AM »
public function is used if we use class everywhere this is simple script for showing image using image tag 

you can add public if you want to be future sure or leave it as now
Solve The Problem, Write The Code :)

*

Pharg

  • *****
  • 2,886
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: big in captcha on php 7 fixed
« Reply #3 on: August 30, 2017, 05:37:13 AM »
Hi Raj2200,

Thanks for the info
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35