Add stronger input validation/output escaping for theme, tags and categories vars
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
$name = sanitizeInput($_POST['name']);
|
$name = sanitizeInput($_POST['name']);
|
||||||
$type = sanitizeInput($_POST['type']);
|
$type = sanitizeInput($_POST['type']);
|
||||||
$color = preg_replace("/[^0-9a-zA-Z_]/", "", sanitizeInput($_POST['color']));
|
$color = preg_replace("/[^0-9a-zA-Z-]/", "", sanitizeInput($_POST['color']));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$name = sanitizeInput($_POST['name']);
|
$name = sanitizeInput($_POST['name']);
|
||||||
$type = intval($_POST['type']);
|
$type = intval($_POST['type']);
|
||||||
$color = preg_replace("/[^0-9a-zA-Z_]/", "", sanitizeInput($_POST['color']));
|
$color = preg_replace("/[^0-9a-zA-Z-]/", "", sanitizeInput($_POST['color']));
|
||||||
$icon = preg_replace("/[^0-9a-zA-Z_]/", "", sanitizeInput($_POST['icon']));
|
$icon = preg_replace("/[^0-9a-zA-Z-]/", "", sanitizeInput($_POST['icon']));
|
||||||
|
|||||||
2
post.php
2
post.php
@@ -870,7 +870,7 @@ if(isset($_POST['edit_theme_settings'])){
|
|||||||
|
|
||||||
validateAdminRole();
|
validateAdminRole();
|
||||||
|
|
||||||
$theme = preg_replace("/[^0-9a-zA-Z_]/", "", sanitizeInput($_POST['theme']));
|
$theme = preg_replace("/[^0-9a-zA-Z-]/", "", sanitizeInput($_POST['theme']));
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme' WHERE company_id = $session_company_id");
|
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme' WHERE company_id = $session_company_id");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user