Permalink
Browse files

Merged fix for bug 3181 from head

  • Loading branch information...
moodler
moodler committed Jul 14, 2005
1 parent 191e433 commit c54473ea397214c64730b2af0fe8e39a07051052
Showing with 11 additions and 12 deletions.
  1. +11 −12 admin/lang.php
View
@@ -2,8 +2,8 @@
require_once("../config.php");
- optional_variable($mode, "");
- optional_variable($currentfile, "moodle.php");
+ $mode = optional_param('mode', '', PARAM_ALPHA);
+ $currentfile = optional_param('currentfile', 'moodle.php', PARAM_FILE);
require_login();
@@ -90,23 +90,22 @@
// For each file, check that a counterpart exists, then check all the strings
foreach ($stringfiles as $file) {
- if (!file_exists("$langdir/$file")) {
- if (!touch("$langdir/$file")) {
- echo "<p><font color=\"red\">".get_string("filemissing", "", "$langdir/$file")."</font></p>";
- continue;
- }
- }
-
unset($string);
include("$enlangdir/$file");
$enstring = $string;
-
+
unset($string);
- include("$langdir/$file");
+
+ if (file_exists("$langdir/$file")) {
+ include("$langdir/$file");
+ } else {
+ notify(get_string("filemissing", "", "$langdir/$file"));
+ $string = array();
+ }
$first = true;
foreach ($enstring as $key => $value) {
- if (!isset($string[$key]) or $string[$key] == "") {
+ if (empty($string[$key])) {
$value = htmlspecialchars($value);
$value = str_replace("$"."a", "\\$"."a", $value);
$value = str_replace("%%","%",$value);

0 comments on commit c54473e

Please sign in to comment.