aboutsummaryrefslogtreecommitdiffstats
path: root/langs
diff options
context:
space:
mode:
Diffstat (limited to 'langs')
-rw-r--r--langs/diff.php11
-rw-r--r--langs/missing.php6
-rw-r--r--langs/report.php8
3 files changed, 13 insertions, 12 deletions
diff --git a/langs/diff.php b/langs/diff.php
index fcc0f93ff..f3c10b895 100644
--- a/langs/diff.php
+++ b/langs/diff.php
@@ -6,13 +6,14 @@
define('HLANG', true);
include 'lib.php';
-$source_file = isset($_GET['s']) ? strip_tags(trim($_GET['s'])) : null;
-$target_lang = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null;
+$source_file = get_sane_string('s');
+$target_lang = get_sane_string('l');
-if (is_null($source_file) ||
- is_null($target_lang)) {
+if (empty($source_file) ||
+ empty($target_lang)) {
- die('kthxbai');
+ header('Location: /langs/report.php');
+ die;
}
if (!file_exists($source_file)) {
diff --git a/langs/missing.php b/langs/missing.php
index 345e9035e..881ed5e99 100644
--- a/langs/missing.php
+++ b/langs/missing.php
@@ -4,10 +4,10 @@
define('HLANG', true);
include 'lib.php';
-$s = isset($_GET['s']) ? strip_tags(trim($_GET['s'])) : null;
-$l = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null;
+$s = get_sane_string('s');
+$l = get_sane_string('l');
-if (is_null($s)) {
+if (empty($s) || empty($l)) {
header('Location: /langs/report.php');
die;
}
diff --git a/langs/report.php b/langs/report.php
index 74bc56f68..0f0d7c0ed 100644
--- a/langs/report.php
+++ b/langs/report.php
@@ -42,14 +42,14 @@
define('HLANG', TRUE);
include 'lib.php';
- $one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : NULL;
- $one_resource = isset($_GET['r']) ? strip_tags(trim($_GET['r'])) : NULL;
+ $one_language = get_sane_string('l');
+ $one_resource = get_sane_string('r');
$one_language_all_resources = FALSE;
$all_languages_only_one_resource = FALSE;
$otherLangs = get_other_langs();
- if (isset($one_language) && $one_language != 'all') {
+ if (!empty($one_language) && $one_language != 'all') {
if (in_array($one_language, $otherLangs)) {
$one_language_all_resources = TRUE;
$otherLangs = array('en', $one_language);
@@ -59,7 +59,7 @@
}
$enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file
- if (isset($one_resource) && $one_resource != 'all') {
+ if (!empty($one_resource) && $one_resource != 'all') {
if (in_array($one_resource, $enFiles)) {
$all_languages_only_one_resource = TRUE;
$enFiles = array($one_resource);