Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixes from Deen Foxx BUg 1638

  • Loading branch information...
commit e2d3d77173080500c72b3e9c12c796f58fcd2835 1 parent 6b63e94
authored July 13, 2004

Showing 1 changed file with 10 additions and 12 deletions. Show diff stats Hide diff stats

  1. 22  admin/lang.php
22  admin/lang.php
@@ -205,26 +205,24 @@
205 205
             $envalue = str_replace("%%","%",$envalue);
206 206
             $envalue = str_replace("\\","",$envalue);              // Delete all slashes
207 207
 
208  
-            echo "<tr>";
209  
-            echo "<td dir=ltr lang=en width=20% bgcolor=\"$THEME->cellheading\" nowrap valign=top>$key</td>";
210  
-            echo "<td dir=ltr lang=en width=40% bgcolor=\"$THEME->cellheading\" valign=top>$envalue</td>";
  208
+            echo "\n\n<tr>";
  209
+            echo "<td dir=ltr lang=en width=20% bgcolor=\"$THEME->cellheading\" nowrap valign=top>$key</td>\n";
  210
+            echo "<td dir=ltr lang=en width=40% bgcolor=\"$THEME->cellheading\" valign=top>$envalue</td>\n";
211 211
 
212 212
             $value = $string[$key];
213 213
             $value = str_replace("\r","",$value);              // Bad character caused by Windows
214  
-            $value = str_replace("\n\n\n\n\n\n","\n",$value);  // Collapse runs of blank lines
215  
-            $value = str_replace("\n\n\n\n\n","\n",$value);
216  
-            $value = str_replace("\n\n\n\n","\n",$value);
217  
-            $value = str_replace("\n\n\n","\n",$value);
218  
-            $value = str_replace("\n\n\n","\n",$value);
  214
+            $value = preg_replace("/\n{3,}/", "\n\n", $value); // Collapse runs of blank lines
  215
+            $value = trim($value, "\n");                       // Delete leading/trailing lines
219 216
             $value = str_replace("\\","",$value);              // Delete all slashes
220 217
             $value = str_replace("%%","%",$value);
221 218
             $value = str_replace("<","&lt;",$value);
222 219
             $value = str_replace(">","&gt;",$value);
  220
+            $value = str_replace('"',"&quot;",$value);
223 221
 
224 222
             $cellcolour = $value ? $THEME->cellcontent: $THEME->highlight;
225 223
 
226 224
             if ($editable) {
227  
-                echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>";
  225
+                echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>\n";
228 226
                 if (isset($string[$key])) {
229 227
                     $valuelen = strlen($value);
230 228
                 } else {
@@ -233,17 +231,17 @@
233 231
                 $cols=50;
234 232
                 if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) {
235 233
                     $rows = ceil($valuelen / $cols);
236  
-                    echo "<textarea name=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</textarea>";
  234
+                    echo "<textarea name=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</textarea>\n";
237 235
                 } else {
238 236
                     if ($valuelen) {
239 237
                         $cols = $valuelen + 2;
240 238
                     }
241 239
                     echo "<input type=\"text\" name=\"string-$key\" value=\"$value\" size=\"$cols\"></td>";
242 240
                 }
243  
-                echo "</TD>";
  241
+                echo "</TD>\n";
244 242
 
245 243
             } else {
246  
-                echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>$value</td>";
  244
+                echo "<td width=40% bgcolor=\"$cellcolour\" valign=top>$value</td>\n";
247 245
             }
248 246
         }
249 247
         if ($editable) {

0 notes on commit e2d3d77

Please sign in to comment.
Something went wrong with that request. Please try again.