Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Commit 8690cc5

Browse files
committed
preg_replace typechecks
1 parent ded0218 commit 8690cc5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

php/core/ParamParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function isLogoutGet() : bool {
4747

4848
public function loginPost(string $name) : string {
4949
if( $name === 'group' ){
50-
return !empty($_POST['group']) ? preg_replace('/[^A-Za-z0-9]/', '', $_POST['group']) : '';
50+
return !empty($_POST['group']) && is_string($_POST['group']) ? preg_replace('/[^A-Za-z0-9]/', '', $_POST['group']) : '';
5151
}
5252
else if($name === 'password' ){
5353
if( !empty($_POST['password']) && is_string($_POST['password']) ) {

php/core/WebGUI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function accountManage() : void {
108108
}
109109
}
110110
}
111-
else if(!empty($_GET['delete'])){
111+
else if(!empty($_GET['delete']) && is_string($_GET['delete'])){
112112
$account->setContent('NOTEDISABLE','');
113113
$g = preg_replace('/[^A-Za-z0-9]/', '', $_GET['delete']);
114114
if(!$this->login->getGroupList()->isValue([$g]) || $g === $this->login->getGroup() ){

0 commit comments

Comments
 (0)