1
0
Fork 0

Sanitize theme path items

- Sanitize theme style/color/scheme path items
This commit is contained in:
Hypolite Petovan 2019-03-31 21:50:00 -04:00
commit b529c03a20
9 changed files with 65 additions and 50 deletions

View file

@ -5,9 +5,11 @@
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Util\Strings;
require_once 'view/theme/frio/php/PHPColors/Color.php';
$scheme = '';
$schemecss = '';
$schemecssfile = false;
$scheme_modified = 0;
@ -67,9 +69,7 @@ if (!empty($_REQUEST['scheme'])) {
$scheme = $_REQUEST['scheme'];
}
// Sanitize the data.
$scheme = !empty($scheme) ? basename($scheme) : '';
$scheme = Strings::sanitizeFilePathItem($scheme);
if (($scheme) && ($scheme != '---')) {
if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {