method isCleanPath documentation in bbn\Str
Checks if ".. \\" or "../" is contained in the parameter and it will return false if true.
Example
X::dump(\bbn\Str::isCleanPath("/home/user/Images"));
// (bool) true
X::dump(\bbn\Str::isCleanPath("../home/user/Images"));
// (bool) false
X::dump(\bbn\Str::isCleanPath("..\\home\user\Images"));
// (bool) false
function()
{
$args = \func_get_args();
foreach ($args as $a){
if (\is_string($a)) {
if ((strpos($a, '../') !== false) || (strpos($a, '..\\') !== false)) {
return false;
}
}
else {
return false;
}
}
return true;
}
Checks if ".. \\" or "../" is contained in the parameter and it will return false if true. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions