CMS MADE SIMPLE FORGE

CGSmartImage

 

[#11919] PHP Notice: Undefined variable: fh

avatar
Created By: Martin Clayton (pinkelephant)
Date Submitted: Mon Oct 29 05:54:57 -0400 2018

Assigned To:
Version: 1.22.4
CMSMS Version: 2.2.8
Severity: Minor
Resolution: Fixed
State: Open
Summary:
PHP Notice: Undefined variable: fh
Detailed Description:
CMSMS 2.2.8
CGSmartImage 1.22.4 
php7.0

| PHP Notice:  Undefined variable: fh in
[...]/modules/CGSmartImage/CGSmartImage.module.php on line 277

Looks like a $fh != $fn typo...

| 277: if( is_file($fh) && filemtime($fn) < $thedate ) {

...in:

// ================

if( $dh = opendir($dir) ) {
    while( ($file = readdir($dh)) !== false ) {
        if( startswith($file,'.') ) continue; // ignore hidden files.
        $fn = cms_join_path($dir,$file);
        if( is_file($fh) && filemtime($fn) < $thedate ) {
            @unlink($fn);
           $n_removed++;
       }
    }
    closedir($dh);
}

// ================

I think this goes back a good few versions.


History

Comments
avatar
Date: 2018-11-03 09:57
Posted By: Robert Campbell (calguy1000)

Fixed in SVN
      
Updates

Updated: 2018-11-03 09:57
resolution_id: => 7