Skip to content

Commit ee6c0e8

Browse files
committed
make sure params are strings for manual-lookup.php (bug #61756)
1 parent 09ca235 commit ee6c0e8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

include/langchooser.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function language_choose_code()
5050
$explicitly_specified = ''; $selected = '';
5151

5252
// Specified for the request (GET/POST parameter)
53-
if (!empty($_REQUEST['lang'])) {
53+
if (!empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) {
5454
$explicitly_specified = language_add(htmlspecialchars($_REQUEST['lang'], ENT_QUOTES, 'UTF-8'), $languages);
5555

5656
// Set the language in a cookie for a year

manual-lookup.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
// BC code, so pattern and function can both be used as
99
// parameters to specify the function name
1010
$function = '';
11-
if (empty($_GET['function'])) {
12-
if (!empty($_GET['pattern'])) {
13-
$function = htmlspecialchars($_GET['pattern'], ENT_QUOTES, 'UTF-8');
14-
}
15-
} else {
11+
if (!empty($_GET['function']) && is_string($_GET['function'])) {
1612
$function = htmlspecialchars($_GET['function'], ENT_QUOTES, 'UTF-8');
13+
} elseif (!empty($_GET['pattern']) && is_string($_GET['pattern'])) {
14+
$function = htmlspecialchars($_GET['pattern'], ENT_QUOTES, 'UTF-8');
1715
}
1816

19-
if(!empty($_GET['scope'])) {
17+
if(!empty($_GET['scope']) && is_string($_GET['scope'])) {
2018
$scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
2119
} else {
2220
$scope = '';

0 commit comments

Comments
 (0)