Steps to reproduce:
1. create new directory
2. name it <>
3. try to delete/rename
it also works the other way round:
1. create new directory
2. name it &
3. try to delete/rename
[fixed] filemanager: delete/rename directory with certain ch
Re: filemanager: delete/rename directory with certain charac
Hello
Personally I don't think this is an issue, but the question would be that do other language charters ie: Accent Marks and Diacritics, will cause this issue.
Cheers -Jeremy
Personally I don't think this is an issue, but the question would be that do other language charters ie: Accent Marks and Diacritics, will cause this issue.
Cheers -Jeremy
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: filemanager: delete/rename directory with certain charac
Well, technically speaking, if FileManager allows you to create the directory, it should allow you to delete/rename it.
The question is... should it allow you to create directories like this? Technically speaking (again) a directory name like > or < or <> or > are legal (if stupid).
So it's decision time. I think I'll make it so that you can't create stupid directories like this. How I'll do it... not exactly sure yet.
The question is... should it allow you to create directories like this? Technically speaking (again) a directory name like > or < or <> or > are legal (if stupid).
So it's decision time. I think I'll make it so that you can't create stupid directories like this. How I'll do it... not exactly sure yet.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: filemanager: delete/rename directory with certain charac
FileManager.module.php already contains a function ContainsIllegalChars(). It could be extended and then reused in action.newdir. Example:
actions.newdir
FileManager.module.php
actions.newdir
Code: Select all
if ($this->ContainsIllegalChars($params["newdirname"]) || $params["newdirname"][0]==".") {
$this->Redirect($id, 'defaultadmin',$returnid,array("fmerror"=>"invalidnewdir"));
}
FileManager.module.php
Code: Select all
function ContainsIllegalChars($filename) {
if (strpos($filename, "'")!==false) return true;
if (strpos($filename, "\"")!==false) return true;
if (strpos($filename, "/")!==false) return true;
if (strpos($filename, "\\")!==false) return true;
if (strpos($filename, "&")!==false) return true;
if (strpos($filename, "\$")!==false) return true;
if (strpos($filename, "+")!==false) return true;
if (strpos($filename, "<")!==false) return true;
if (strpos($filename, ">")!==false) return true;
return false;
}
Last edited by dwave on Sun Aug 28, 2011 10:32 am, edited 1 time in total.
Re: filemanager: delete/rename directory with certain charac
it would be very odd to even want to have them, but +1 for the check -Jcalguy1000 wrote: The question is... should it allow you to create directories like this? Technically speaking (again) a directory name like > or < or <> or > are legal (if stupid).
Re: filemanager: delete/rename directory with certain charac
Fixed. I can't create folder with name <> in latest svn.calguy1000 wrote:I think I'll make it so that you can't create stupid directories like this. How I'll do it... not exactly sure yet.
Please confirm
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -