* functions are not available. Scripts in functions/ directory should not
* setup anything when they are loaded.
*
- * @copyright © 1999-2009 The SquirrelMail Project Team
+ * @copyright 1999-2014 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @param mixed $locale option contains array with possible locales or string with one locale
* @return string name of set locale or false, if all locales fail.
* @since 1.4.5 and 1.5.1
- * @see http://www.php.net/setlocale
+ * @see http://php.net/setlocale
*/
function sq_setlocale($category,$locale) {
if (is_string($locale)) {
* @param string $string Text to be decoded
* @param boolean $force_decode converts string to html without $charset!=$default_charset check.
* Argument is available since 1.4.5 and 1.5.1.
- * @param boolean $save_html disables htmlspecialchars() in order to preserve
+ * @param boolean $save_html disables sm_encode_html_special_chars() in order to preserve
* html formating. Use with care. Available since 1.4.6 and 1.5.1
* @return string decoded string
*/
// Don't do conversion if charset is the same.
if ( ! $force_decode && $charset == strtolower($default_charset) )
- return ($save_html ? $string : htmlspecialchars($string));
+ return ($save_html ? $string : sm_encode_html_special_chars($string));
// catch iso-8859-8-i thing
if ( $charset == "iso-8859-8-i" )
// other charsets can be converted to utf-8 without loss.
// and output string is smaller
$string = recode_string($charset . "..utf-8",$string);
- return ($save_html ? $string : htmlspecialchars($string));
+ return ($save_html ? $string : sm_encode_html_special_chars($string));
} else {
$string = recode_string($charset . "..html",$string);
- // recode does not convert single quote, htmlspecialchars does.
+ // recode does not convert single quote, sm_encode_html_special_chars does.
$string = str_replace("'", ''', $string);
// undo html specialchars
if ($save_html)
// iconv functions does not have html target and can be used only with utf-8
if ( $use_php_iconv && $default_charset=='utf-8') {
$string = iconv($charset,$default_charset,$string);
- return ($save_html ? $string : htmlspecialchars($string));
+ return ($save_html ? $string : sm_encode_html_special_chars($string));
}
// If we don't use recode and iconv, we'll do it old way.
/* All HTML special characters are 7 bit and can be replaced first */
- if (! $save_html) $string = htmlspecialchars ($string);
+ if (! $save_html) $string = sm_encode_html_special_chars ($string);
/* controls cpu and memory intensive decoding cycles */
if (! isset($aggressive_decoding) || $aggressive_decoding=="" ) {
* @since 1.4.4 and 1.5.1
* @param string $string
* @param string $charset
- * @param boolean $htmlencode keep htmlspecialchars encoding
+ * @param boolean $htmlencode keep sm_encode_html_special_chars encoding
* @return string
*/
function charset_encode($string,$charset,$htmlencode=true) {
* @param string $in_charset initial charset
* @param string $string string that has to be converted
* @param string $out_charset final charset
- * @param boolean $htmlencode keep htmlspecialchars encoding
+ * @param boolean $htmlencode keep sm_encode_html_special_chars encoding
* @return string converted string
*/
function charset_convert($in_charset,$string,$out_charset,$htmlencode=true) {
* mbstring.func_overload fix (#929644).
*
* php mbstring extension can replace standard string functions with their multibyte
- * equivalents. See http://www.php.net/ref.mbstring#mbstring.overload. This feature
+ * equivalents. See http://php.net/ref.mbstring#mbstring.overload. This feature
* was added in php v.4.2.0
*
* Some SquirrelMail functions work with 8bit strings in bytes. If interface is forced
* ALTNAME - Native translation name. Any 8bit symbols must be html encoded.
* LOCALE - Full locale name (in xx_XX.charset format). It can use array with more than one locale name since 1.4.5 and 1.5.1
* DIR - Text direction. Used to define Right-to-Left languages. Possible values 'rtl' or 'ltr'. If undefined - defaults to 'ltr'
- * XTRA_CODE - translation uses special functions. See http://www.squirrelmail.org/docs/devel/devel-3.html
+ * XTRA_CODE - translation uses special functions. See http://squirrelmail.org/docs/devel/devel-3.html
*
* Each 'language' definition requires NAME+CHARSET or ALIAS variables.
*