Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes from Deen Foxx BUg 1638

  • Loading branch information...
commit e2d3d77173080500c72b3e9c12c796f58fcd2835 1 parent 6b63e94
moodler authored
Showing with 10 additions and 12 deletions.
  1. +10 −12 admin/lang.php
22 admin/lang.php
View
@@ -205,26 +205,24 @@
$envalue = str_replace("%%","%",$envalue);
$envalue = str_replace("\\","",$envalue); // Delete all slashes
- echo "<tr>";
- echo "<td dir=ltr lang=en width=20% bgcolor=\"$THEME->cellheading\" nowrap valign=top>$key</td>";
- echo "<td dir=ltr lang=en width=40% bgcolor=\"$THEME->cellheading\" valign=top>$envalue</td>";
+ echo "\n\n<tr>";
+ echo "<td dir=ltr lang=en width=20% bgcolor=\"$THEME->cellheading\" nowrap valign=top>$key</td>\n";
+ echo "<td dir=ltr lang=en width=40% bgcolor=\"$THEME->cellheading\" valign=top>$envalue</td>\n";
$value = $string[$key];
$value = str_replace("\r","",$value); // Bad character caused by Windows
- $value = str_replace("\n\n\n\n\n\n","\n",$value); // Collapse runs of blank lines
- $value = str_replace("\n\n\n\n\n","\n",$value);
- $value = str_replace("\n\n\n\n","\n",$value);
- $value = str_replace("\n\n\n","\n",$value);
- $value = str_replace("\n\n\n","\n",$value);
+ $value = preg_replace("/\n{3,}/", "\n\n", $value); // Collapse runs of blank lines
+ $value = trim($value, "\n"); // Delete leading/trailing lines
$value = str_replace("\\","",$value); // Delete all slashes
$value = str_replace("%%","%",$value);
$value = str_replace("<","&lt;",$value);
$value = str_replace(">","&gt;",$value);
+ $value = str_replace('"',"&quot;",$value);
$cellcolour = $value ? $THEME->cellcontent: $THEME->highlight;
if ($editable) {
- echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>";
+ echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>\n";
if (isset($string[$key])) {
$valuelen = strlen($value);
} else {
@@ -233,17 +231,17 @@
$cols=50;
if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) {
$rows = ceil($valuelen / $cols);
- echo "<textarea name=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</textarea>";
+ echo "<textarea name=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</textarea>\n";
} else {
if ($valuelen) {
$cols = $valuelen + 2;
}
echo "<input type=\"text\" name=\"string-$key\" value=\"$value\" size=\"$cols\"></td>";
}
- echo "</TD>";
+ echo "</TD>\n";
} else {
- echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>$value</td>";
+ echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>$value</td>\n";
}
}
if ($editable) {
Please sign in to comment.
Something went wrong with that request. Please try again.