Skip to content

Commit

Permalink
URL within menu module could not be relative anymore #1148
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Jan 3, 2022
1 parent f9e8715 commit 5720147
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions adm_program/modules/menu/menu_function.php
Expand Up @@ -49,7 +49,7 @@
$postComId = admFuncVariableIsValid($_POST, 'men_com_id', 'int');
$postName = admFuncVariableIsValid($_POST, 'men_name', 'string', array('default' => ''));
$postDesc = admFuncVariableIsValid($_POST, 'men_description', 'string', array('default' => ''));
$postUrl = admFuncVariableIsValid($_POST, 'men_url', 'url', array('default' => ''));
$postUrl = $_POST['men_url'];
$postIcon = admFuncVariableIsValid($_POST, 'men_icon', 'string', array('default' => ''));

// within standard menu items the url should not be changed
Expand All @@ -65,8 +65,13 @@
// => EXIT
}

if($postUrl === '')
{
if(!StringUtils::strValidCharacters($postUrl, 'url')
&& !preg_match('=^[^?*;:~<>|\"\\\\]+$=', $postUrl)) {
$gMessage->show($gL10n->get('SYS_URL_INVALID_CHAR', array($gL10n->get('ORG_URL'))));
// => EXIT
}

if ($postUrl === '') {
$gMessage->show($gL10n->get('SYS_FIELD_EMPTY', array($gL10n->get('ORG_URL'))));
// => EXIT
}
Expand Down

0 comments on commit 5720147

Please sign in to comment.