Decoded Output
Download<?php
/**
* Joomlatools Framework - https://www.joomlatools.com/developer/framework/
*
* @copyright Copyright (C) 2011 Johan Janssens and Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://github.com/joomlatools/joomlatools-framework-files for the canonical source repository
*/
/**
* Folder Name Filter
*
* @author Ercan Ozkaya <https://github.com/ercanozkaya>
* @package Koowa\Component\Files
*/
class ComFilesFilterFolderName extends KFilterAbstract
{
protected static $_rejected_names = array('.htaccess', 'web.config', 'index.htm', 'index.html', 'index.php', '.svn', '.git', 'cvs');
public function validate($entity)
{
$value = $entity->name;
if (strpos($value, '/') !== false) {
return $this->_error($this->getObject('translator')->translate('Folder names cannot contain slashes'));
}
$value = $this->sanitize($value);
if (in_array(strtolower($value), self::$_rejected_names))
{
return $this->_error($this->getObject('translator')->translate(
'You cannot create a folder named {foldername} for security reasons.',
array('foldername' => $value)
));
}
if ($value == '') {
return $this->_error($this->getObject('translator')->translate('Invalid folder name'));
}
return true;
}
public function sanitize($value)
{
$value = str_replace('/', '', $value);
return $this->getObject('com:files.filter.path')->sanitize($value);
}
}
?>
Did this file decode correctly?
How would you describe this file?
Thank you for your feedback! This will help us detect malicious PHP files more accurately in the future.
Function Calls
None
Variables
None
Stats
| MD5 | 32e3c42e05e9eb87 |
|---|---|
| Eval Count | 0 |
| Decode Time | 103 ms |
Original Code
<?php
/**
* Joomlatools Framework - https://www.joomlatools.com/developer/framework/
*
* @copyright Copyright (C) 2011 Johan Janssens and Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://github.com/joomlatools/joomlatools-framework-files for the canonical source repository
*/
/**
* Folder Name Filter
*
* @author Ercan Ozkaya <https://github.com/ercanozkaya>
* @package Koowa\Component\Files
*/
class ComFilesFilterFolderName extends KFilterAbstract
{
protected static $_rejected_names = array('.htaccess', 'web.config', 'index.htm', 'index.html', 'index.php', '.svn', '.git', 'cvs');
public function validate($entity)
{
$value = $entity->name;
if (strpos($value, '/') !== false) {
return $this->_error($this->getObject('translator')->translate('Folder names cannot contain slashes'));
}
$value = $this->sanitize($value);
if (in_array(strtolower($value), self::$_rejected_names))
{
return $this->_error($this->getObject('translator')->translate(
'You cannot create a folder named {foldername} for security reasons.',
array('foldername' => $value)
));
}
if ($value == '') {
return $this->_error($this->getObject('translator')->translate('Invalid folder name'));
}
return true;
}
public function sanitize($value)
{
$value = str_replace('/', '', $value);
return $this->getObject('com:files.filter.path')->sanitize($value);
}
}