includes/lang.php
changeset 376 66732bd4532c
parent 372 5bd429428101
child 377 bb3e6c3bd4f4
--- a/includes/lang.php	Thu Jan 24 22:14:40 2008 -0500
+++ b/includes/lang.php	Sat Jan 26 11:51:19 2008 -0500
@@ -456,6 +456,22 @@
   
   function get($string_id, $substitutions = false)
   {
+    if ( !is_array($substitutions) )
+      $substitutions = array();
+    return $this->substitute($this->get_uncensored($string_id), $substitutions);
+  }
+  
+  /**
+   * The same as get(), but does not perform any substitution or filtering. Used in get() (of course) and in the admin panel, where
+   * strings are updated only if they were changed.
+   *
+   * @param string ID of the string to fetch. This will always be in the format of category_stringid.
+   * @param array Optional. Associative array of substitutions.
+   * @return string
+   */
+  
+  function get_uncensored($string_id, $substitutions = false)
+  {
     // Extract the category and string ID
     $category = substr($string_id, 0, ( strpos($string_id, '_') ));
     $string_name = substr($string_id, ( strpos($string_id, '_') + 1 ));
@@ -486,7 +502,7 @@
         {
           if ( !is_object($this->default) )
             $this->default = new Language($lang_default);
-          return $this->default->get($string_id, $substitutions);
+          return $this->default->get_uncensored($string_id);
         }
       }
     }
@@ -496,12 +512,7 @@
       return $string_id;
     }
     // Found it!
-    // Perform substitutions.
-    // if ( is_array($substitutions) )
-    //   die('<pre>' . print_r($substitutions, true) . '</pre>');
-    if ( !is_array($substitutions) )
-      $substitutions = array();
-    return $this->substitute($string, $substitutions);
+    return $string;
   }
   
   /**