CMS MADE SIMPLE FORGE

Captcha

 

[#7427] PHP5 incompatibility / deprecated PHP4 functions

avatar
Created By: Palatinux (palatinux)
Date Submitted: Fri Jan 06 19:46:20 -0500 2012

Assigned To:
Version: 0.4.5
CMSMS Version: None
Severity: Major
Resolution: Fixed
State: Closed
Summary:
PHP5 incompatibility / deprecated PHP4 functions
Detailed Description:
Dear developers,

We have noticed that your module still uses deprecated PHP4 functions which are
going to be incompatible with newer PHP5> functions. A solution for the first
error can be found here: http://alturl.com/ya244


The Fortress Linux Security Team
http://www.fortresslinux.org


Report:

*Notice*: Indirect modification of overloaded property CmsObject::$db has no 
effect in 
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *188*

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*


History

Comments
avatar
Date: 2012-01-26 05:23
Posted By: Jean-Claude Etiemble (jce76350)

Hi,

For *Notice*: Indirect modification of overloaded property CmsObject::$db has no
effect in  */modules/Captcha/lib/classes/module/class.captcha.php* 
on line *188*

Please test this on line 188
//			$this->admin = new CaptchaModuleAdmin($this->cms->db, $this->smarty); 
$this->admin = new CaptchaModuleAdmin($this->GetDb(), $this->smarty);  //
modified


for *Strict Standards*: Non-static method  ...
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

Into \Captcha\lib\classes\class.file_operations.php  
remplace  function isImageFilename($name) 
By  Public static function isImageFilename($name)

Nota bug [#7349] have the same solution


++W3C error++
\Captcha\lib\hn_captcha\hn_captcha.class.php5
line 860 
modify  (see: www.captcha.net)" title="">'."\n";  
By    (see: www.captcha.net)" title="" />'."\n"; 

      
avatar
Date: 2012-01-27 20:46
Posted By: Palatinux (palatinux)

Hello Jean-Claude. 

The first fix works for "effect in 
*/modules/Captcha/lib/classes/module/class.captcha.php* on line *188*"

The second one for "/modules/Captcha/lib/classes/module/class.captcha.php* on
line *974*" doesn't seem to work. The old function is:


				if (CMSCaptchaFileOperations::isImageFilename($file))
				{
					$filenames[] = $file;
				}


How should it be changed? Its not very clear to me what you exactly mean with
your fix or it just doesn't work :)



I haven't reported the last one, but this makes your module W3C compatible. Very
good. Would be nice if all cms developers  did the same :)
      
avatar
Date: 2012-01-28 07:46
Posted By: Palatinux (palatinux)

Hello Jean-Claude, 

I indeed missed something while reading your post. To fix this message:

*Strict Standards*: Non-static method 
CMSCaptchaFileOperations::isImageFilename() should not be called statically, 
assuming $this from incompatible context in 
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*


You have to edit modules/Captcha/lib/classes/class.file_operations.php and
replace this line

"function isImageFilename($name)"

with

"Public static function isImageFilename($name)"

      
avatar
Date: 2012-03-06 17:18
Posted By: Ponk (ponk)

Hello,

I had the same trouble with I've tried Palatinux's solution but no way, still
got the error message so
I've tried to replace /modules/Captcha/lib/classes/module/class.captcha.php line
188

$this->admin = new CaptchaModuleAdmin($this->cms->db, $this->smarty);

by 

$this->admin = new CaptchaModuleAdmin(cmsms()->getDb(), $this->smarty);

and it seems to work now.


      
avatar
Date: 2014-02-22 01:31
Posted By: Ashish (AshishRRR)

I was facing issue:
*/modules/Captcha/lib/classes/module/class.captcha.php* 
on line *974*

and i edit modules/Captcha/lib/classes/class.file_operations.php and replace
this line
"function isImageFilename($name)"
with
"Public static function isImageFilename($name)"

Now Its working fine.

Thanks to Palatinux
      
avatar
Date: 2014-09-22 13:36
Posted By: Fernando Morgado (JoMorg)

fixed in svn and to be released soon.thanks
      
Updates

Updated: 2016-05-22 06:16
state: Open => Closed

Updated: 2014-09-22 13:36
resolution_id: => 7
cmsms_version_id: 29321 => -1