PHP Classes

bug

Recommend this page to a friend!

      Dir Tool  >  All threads  >  bug  >  (Un) Subscribe thread alerts  
Subject:bug
Summary:Bug when using this package on Windows
Messages:1
Author:szako
Date:2009-12-20 14:26:14
 

  1. bug   Reply   Report abuse  
Picture of szako szako - 2009-12-20 14:26:14
Hi

You need to do addslashes() before the preg_replace method to get it working under __Windows__.

for example.

95th line of class_dirtool.php

$pattern = "^".$this->from."^";
to
$pattern = addslashes("#".$this->from."#");

It's needed because Win path comes with "\" and you need to slash it to successfully regex it.

Need to be done in copy_tree(), copy_files() and delete_files().

Btw nice, useful class!