Skip to content

Commit

Permalink
Fix XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 9, 2017
1 parent 6d01bd7 commit 2fc64b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -302,7 +302,7 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
break;
case 'aZ09':
$out=trim($out);
if (preg_match('/[^a-z0-9]+/i',$out)) $out='';
if (preg_match('/[^a-z0-9_]+/i',$out)) $out='';
break;
case 'array':
if (! is_array($out) || empty($out)) $out=array();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/index.php
Expand Up @@ -30,7 +30,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';

// If not defined, we select menu "home"
$_GET['mainmenu']=GETPOST('mainmenu', 'alpha')?GETPOST('mainmenu', 'alpha'):'home';
$_GET['mainmenu']=GETPOST('mainmenu', 'aZ09')?GETPOST('mainmenu', 'aZ09'):'home';
$action=GETPOST('action');

$hookmanager->initHooks(array('index'));
Expand Down

0 comments on commit 2fc64b8

Please sign in to comment.