Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Пробелы в путях #113

Open
soar opened this issue Feb 11, 2016 · 1 comment
Open

Пробелы в путях #113

soar opened this issue Feb 11, 2016 · 1 comment

Comments

@soar
Copy link

soar commented Feb 11, 2016

Если имя файла содержит пробел - получаем ворнинг:

PHP Warning:  filesize(): stat failed for /custom/include/PHPExcel/PHPExcel/Chart/Renderer/PHP in /manul/classes/MalwareDetector.inc.php on line 122

для /custom/include/PHPExcel/PHPExcel/Chart/Renderer/PHP\ Charting\ Libraries.txt

или

PHP Warning:  filesize(): stat failed for /images/mainmenu_\xd0\x9e\xd0\xb1\xd1\x8a\xd0\xb5\xd0\xba\xd1\x82\xd1\x8b in /manul/classes/MalwareDetector.inc.php on line 122

для /images/mainmenu_Объекты недвижимости.png

Видимо сканер эти файлы пропускает и идёт дальше. Но, что хуже, через некоторое время вываливается другая ошибка:

PHP Notice:  Undefined variable: filePath in /manul/classes/MalwareDetector.inc.php on line 411

Выглядит она вот так:

2016-02-12 00-12-10 - firefox developer edition

Сканирование при этом уже не продолжить.

PS: И еще, периодически, получаем:

PHP Notice:  Undefined property: MalwareDetector::$AJAX_HEADER_ERROR in /manul/classes/MalwareDetector.inc.php on line 53
@kolyandula
Copy link

Там хеш файла и путь к нему разделяется пробелом.
MalwareDetector.inc.php строка 373

$fileinfo = explode(' ', $line);

$filePath = $fileinfo[0];
$fileHash = $fileinfo[1];

Когда путь к файлу содежит пробелы получается ерунда.
Тут нужен поиск самого последнего пробела.

$p = strrpos($line, ' ');

$filePath = substr($line, 0, $p);
$fileHash = substr($line, $p + 1);

kolyandula added a commit to kolyandula/manul that referenced this issue May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants