Skip to content

Commit 5309338

Browse files
author
Till Brehm
committed
Added regex check for next_tab variable in form handler.
1 parent 637bab3 commit 5309338

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

interface/lib/classes/tform.inc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,18 @@ function getNextTab() {
115115
// Show the same tab again in case of an error
116116
$active_tab = $_SESSION["s"]["form"]["tab"];
117117
}
118+
119+
if(!preg_match('/^[a-zA-Z0-9_]{0,50}$/',$active_tab)) {
120+
die('Invalid next tab name.');
121+
}
118122

119123
return $active_tab;
120124
}
121125

122126
function getCurrentTab() {
127+
if(!preg_match('/^[a-zA-Z0-9_]{0,50}$/',$_SESSION["s"]["form"]["tab"])) {
128+
die('Invalid current tab name.');
129+
}
123130
return $_SESSION["s"]["form"]["tab"];
124131
}
125132

0 commit comments

Comments
 (0)