$displayedUrl = $url;
}
- return $pre . '<a href="' . $linkedUrl . '" rel="nofollow">' . shorten($displayedUrl,30,'...') . '</a>' . $post;
+ return $pre . '<a href="' . $linkedUrl . '" rel="nofollow">' . i18n::hsc(shorten($displayedUrl,30,'...')) . '</a>' . $post;
}
* of the License, or (at your option) any later version.
* (see nucleus/documentation/index.html#license for more info)
*/
-/**ss
+/**
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2009 The Nucleus Group
* @version $Id: globalfunctions.php 1624 2012-01-09 11:36:20Z sakamocchi $
}
/**
- * shortens a text string to maxlength
+ * shortens a text string to maxlength.
* $suffix is what needs to be added at the end (end length is <= $maxlength)
*
* The purpose is to limit the width of string for rendered screen in web browser.
* So it depends on style sheet, browser's rendering scheme, client's system font.
*
- * NOTE: In general, non-Latin font such as Japanese, Chinese, Cyrillic have two times as long as Latin fonts,
+ * NOTE: In general, non-Latin font such as Japanese, Chinese, Cyrillic have two times as width as Latin fonts,
* but this is not always correct, for example, rendered by proportional font.
*
* @param string $escaped_string target string
echo ' selected="selected" ';
if (isset($template['shorten']) && $template['shorten'] > 0) {
echo ' title="'. i18n::hsc($current->text).'"';
- $current->text = shorten($current->text, $template['shorten'], $template['shortenel']);
+ $current->text = i18n::hsc(shorten($current->text, $template['shorten'], $template['shortenel']));
}
echo '>' . i18n::hsc($current->text) . '</option>';
break;