Changeset 2917 for trunk


Ignore:
Timestamp:
Dec 3, 2008, 12:28:32 AM (16 years ago)
Author:
plg
Message:

merge r2916 from branch 2.0 to trunk

bug 904 fixed: an index.htm is created in directories created by
pwg.images.add web API method, only directories that contains pictures.

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r2856 r2917  
    15411541  return $str; //???
    15421542}
     1543
     1544/**
     1545 * makes sure a index.htm protects the directory from browser file listing
     1546 *
     1547 * @param string dir directory
     1548 */
     1549function secure_directory($dir)
     1550{
     1551  $file = $dir.'/index.htm';
     1552  if (!file_exists($file))
     1553  {
     1554    @file_put_contents($file, 'Not allowed!');
     1555  }
     1556}
    15431557?>
  • trunk/include/ws_functions.inc.php

    r2786 r2917  
    952952  }
    953953
     954  secure_directory($upload_dir);
     955
    954956  // compute file path
    955957  $date_string = preg_replace('/[^\d]/', '', $dbnow);
     
    994996    }
    995997  }
     998
     999  secure_directory($thumbnail_dir);
    9961000
    9971001  // thumbnail path, the filename may use a prefix and the extension is
     
    10441048      }
    10451049    }
     1050   
     1051    secure_directory($high_dir);
    10461052   
    10471053    // high resolution path, same name as web size file
Note: See TracChangeset for help on using the changeset viewer.