PHP Classes

bugs

Recommend this page to a friend!

      aFiles  >  All threads  >  bugs  >  (Un) Subscribe thread alerts  
Subject:bugs
Summary:Errors in cp and mv functions
Messages:1
Author:Lammers
Date:2008-04-25 13:10:51
 

  1. bugs   Reply   Report abuse  
Picture of Lammers Lammers - 2008-04-25 13:10:52
You have a bugs in cp and mv functions (sample: from string 400 to 406 in aFiles.php)

foreach($path as $file)
{
if (is_file($file)){

copy($file, $where.'/'.$name);

}

And what happens if we put into file value absolute path to file?
$file = '/var/www/customers/sample.php';
$where = '/var/www/customers/samples/';
function copy try to copy file from '/var/www/customers/sample.php' to '/var/www/customers/samples///var/www/customers/sample.php'

It whoud be better:

foreach($path as $file)
{
if (is_file($file)){
$name = ''
$info = pathinfo($file);
$name = $info['basename'];
unset($info);
if($name) copy($file, $where.'/'.$name);
unset($name)

}