Changeset 1102


Ignore:
Timestamp:
Mar 25, 2006, 6:29:03 PM (18 years ago)
Author:
chrisaga
Message:

-improvement : function l10n renamed raw_l10n, new function l10n uses raw_l10n and returns a string with
all html entities transcoded. We should use l10n everywere instead of $lang...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r1095 r1102  
    748748 * @return string
    749749 */
     750function raw_l10n($key)
     751{
     752  global $lang, $conf;
     753
     754  if ($conf['debug_l10n'] and !isset($lang[$key]))
     755  {
     756    echo '[l10n] language key "'.$key.'" is not defined<br />';
     757  }
     758
     759  return isset($lang[$key]) ? $lang[$key] : $key;
     760}
     761/**
     762 * Like l10n but converts html entities
     763 *
     764 * @param string key
     765 * @return string
     766 */
    750767function l10n($key)
    751768{
    752   global $lang, $conf;
    753 
    754   if ($conf['debug_l10n'] and !isset($lang[$key]))
    755   {
    756     echo '[l10n] language key "'.$key.'" is not defined<br />';
    757   }
    758 
    759   return isset($lang[$key]) ? $lang[$key] : $key;
     769  return htmlentities(raw_l10n($key),ENT_QUOTES);
    760770}
    761771
Note: See TracChangeset for help on using the changeset viewer.