From 828ba66500f49571f2007cacee25b18dce74336f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 19 Jun 2003 17:26:27 +0000 Subject: - Bugfix: fixed utf-8 problem for people that use PHP 4.2.x or below. Patch #33 by Al. - Bugfix: fixed translation problems in the user module and the block module. Patch by Stefan. - Improvement: made it impossible to delete user role #1 and #2. Patch #38 by Al. - Improvement: fixed the "Allowed HTML tag" issues. Makes for better code and improved usability. Patch #35 by Al. NOTE: as soon the compose tips make their way into CVS, most of this code can be removed. --- includes/common.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 228e6d339..ec534759f 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -203,7 +203,15 @@ function variable_del($name) { } function drupal_specialchars($input, $quotes = ENT_NOQUOTES) { - return htmlspecialchars($input, $quotes, "utf-8"); + + /* + ** Note that we'd like to go 'htmlspecialchars($input, $quotes, "utf-8")' + ** like the PHP manual tells us to, but we can't because there's a bug in + ** PHP <4.3 that makes it mess up multibyte charsets if we specify the + ** charset. Change this later once we make PHP 4.3 a requirement. + */ + + return htmlspecialchars($input, $quotes); } function table_cell($cell, $header = 0) { @@ -877,6 +885,10 @@ function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $ return form_select($title, $name, $value, $weights, $description, $extra); } +function form_allowed_tags_text() { + return variable_get("allowed_html", "") ? (t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", ""))) : ""; +} + function url($url = NULL, $query = NULL) { global $base_url; -- cgit v1.2.3