forked from Wavyzz/dolibarr
Fix GETPOST with restricthtml
This commit is contained in:
@@ -138,13 +138,13 @@ if (empty($action) && !GETPOSTISSET('action')) {
|
|||||||
if ($action == 'default') { // When action is default, we want a calendar view and not the list
|
if ($action == 'default') { // When action is default, we want a calendar view and not the list
|
||||||
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
||||||
}
|
}
|
||||||
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
||||||
$action = 'show_month'; $day = '';
|
$action = 'show_month'; $day = '';
|
||||||
} // View by month
|
} // View by month
|
||||||
if (GETPOST('viewweek', 'restricthtml') || GETPOST('action', 'alpha') == 'show_week') {
|
if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') {
|
||||||
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||||
} // View by week
|
} // View by week
|
||||||
if (GETPOST('viewday', 'restricthtml') || GETPOST('action', 'alpha') == 'show_day') {
|
if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') {
|
||||||
$action = 'show_day'; $day = ($day ? $day : date("d"));
|
$action = 'show_day'; $day = ($day ? $day : date("d"));
|
||||||
} // View by day
|
} // View by day
|
||||||
|
|
||||||
|
|||||||
@@ -779,7 +779,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
|
|||||||
do {
|
do {
|
||||||
$oldstringtoclean = $out;
|
$oldstringtoclean = $out;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') {
|
if (!empty($out) && !empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') {
|
||||||
try {
|
try {
|
||||||
$dom = new DOMDocument;
|
$dom = new DOMDocument;
|
||||||
$dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL);
|
$dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL);
|
||||||
|
|||||||
Reference in New Issue
Block a user