From: Jan Schneider Date: Sun, 3 Oct 2010 16:46:17 +0000 (+0200) Subject: All data passed around in Horde internally should be UTF-8. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e60da622060274282dd92c2d41c4c0dce4724dd6;p=horde.git All data passed around in Horde internally should be UTF-8. --- diff --git a/agora/lib/Messages.php b/agora/lib/Messages.php index d450a801b..fb9e43691 100644 --- a/agora/lib/Messages.php +++ b/agora/lib/Messages.php @@ -566,7 +566,7 @@ class Agora_Messages { strftime($GLOBALS['prefs']->getValue('date_format'), $message['message_timestamp'])) . "\n-------------------------------------------------------\n" . $message['body']; - $message['body'] = "\n> " . Horde_String::wrap($message['body'], 60, "\n> ", 'UTF-8'); + $message['body'] = "\n> " . Horde_String::wrap($message['body'], 60, "\n> "); return $message; } @@ -993,7 +993,7 @@ class Agora_Messages { foreach ($messages as $id => &$message) { $message['message_id'] = $id; $message['message_author'] = htmlspecialchars($message['message_author']); - $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, 'UTF-8'); + $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject'])); $message['message_date'] = $this->dateFormat($message['message_timestamp']); if ($format) { $message['body'] = $this->formatBody($this->convertFromDriver($message['body'])); @@ -1147,7 +1147,7 @@ class Agora_Messages { $message['forum_name'] = $this->convertFromDriver($forums_list[$message['forum_id']]); $message['message_id'] = $id; $message['message_author'] = htmlspecialchars($message['message_author']); - $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, 'UTF-8'); + $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject'])); $message['message_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')filter($this->convertFromDriver($message['body']), 'highlightquotes'); if ($message['attachments']) { $message['message_attachment'] = $this->getAttachmentLink($id); diff --git a/agora/rss/index.php b/agora/rss/index.php index 441ac1a44..c58273827 100644 --- a/agora/rss/index.php +++ b/agora/rss/index.php @@ -24,7 +24,7 @@ if (!$rss) { $forums = Agora_Messages::singleton($scope); $forums_list = $forums->getForums(0, true, 'forum_name', 0); - $rss = ' + $rss = ' ' . htmlspecialchars($title) . ' @@ -50,5 +50,5 @@ if (!$rss) { $cache->set($cache_key, $rss); } -header('Content-type: text/xml; charset=' . 'UTF-8'); +header('Content-type: text/xml; charset=UTF-8'); echo $rss; diff --git a/agora/rss/messages.php b/agora/rss/messages.php index a6432413c..c0b8fa762 100644 --- a/agora/rss/messages.php +++ b/agora/rss/messages.php @@ -31,7 +31,7 @@ if (!$rss) { exit; } - $rss = ' + $rss = ' ' . htmlspecialchars($message['message_subject']) . ' @@ -59,5 +59,5 @@ if (!$rss) { $cache->set($cache_key, $rss); } -header('Content-type: text/xml; charset=' . 'UTF-8'); +header('Content-type: text/xml; charset=UTF-8'); echo $rss; diff --git a/agora/rss/threads.php b/agora/rss/threads.php index 5e9b37a82..bd9120c61 100644 --- a/agora/rss/threads.php +++ b/agora/rss/threads.php @@ -59,7 +59,7 @@ if (!$rss) { $threads_list = $threads->getThreads(0, false, 'message_modifystamp', 1, true, '', null, 0, 10); - $rss = ' + $rss = ' ' . htmlspecialchars($title) . ' @@ -98,5 +98,5 @@ if (!$rss) { $cache->set($cache_key, $rss); } -header('Content-type: text/xml; charset=' . 'UTF-8'); +header('Content-type: text/xml; charset=UTF-8'); echo $rss; diff --git a/agora/templates/common-header.inc b/agora/templates/common-header.inc index d8a3bc7de..107e07f94 100644 --- a/agora/templates/common-header.inc +++ b/agora/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/ansel/gallery/sort.php b/ansel/gallery/sort.php index 2a5c60077..b941e345a 100644 --- a/ansel/gallery/sort.php +++ b/ansel/gallery/sort.php @@ -69,7 +69,7 @@ require ANSEL_TEMPLATES . '/common-header.inc'; echo Horde::menu(); $notification->notify(array('listeners' => 'status')); ?> -

+

@@ -91,7 +91,7 @@ $notification->notify(array('listeners' => 'status')); getImages(); foreach ($images as $image) { - $caption = empty($image->caption) ? htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8') : htmlspecialchars($image->caption, ENT_COMPAT, 'UTF-8'); + $caption = htmlspecialchars(empty($image->caption) ? $image->filename : $image->caption); echo '
' . '' . htmlspecialchars($image->filename) . '' diff --git a/ansel/img/ecard.php b/ansel/img/ecard.php index d0ec98001..01bbf3a05 100644 --- a/ansel/img/ecard.php +++ b/ansel/img/ecard.php @@ -35,12 +35,10 @@ case 'send': break; } - $charset = 'UTF-8'; - /* Create the text part. */ $textpart = new Horde_Mime_Part(); $textpart->setType('text/plain'); - $textpart->setCharset($charset); + $textpart->setCharset('UTF-8'); $textpart->setContents(_("You have been sent an Ecard. To view the Ecard, you must be able to view text/html messages in your mail reader. If you are viewing this message, then most likely your mail reader does not support viewing text/html messages.")); /* Create the multipart/related part. */ @@ -50,7 +48,7 @@ case 'send': /* Create the HTML part. */ $htmlpart = new Horde_Mime_Part(); $htmlpart->setType('text/html'); - $htmlpart->setCharset($charset); + $htmlpart->setCharset('UTF-8'); /* The image part */ $imgpart = new Horde_Mime_Part(); @@ -73,7 +71,7 @@ case 'send': $alternative->addPart($related); /* Add them to the mail message */ - $alt = new Horde_Mime_Mail(array('subject' => _("Ecard - ") . Horde_Util::getFormData('image_desc'), 'to' => $to, 'from' => $from, 'charset' => $charset)); + $alt = new Horde_Mime_Mail(array('subject' => _("Ecard - ") . Horde_Util::getFormData('image_desc'), 'to' => $to, 'from' => $from, 'charset' => 'UTF-8')); $alt->setBasePart($alternative); /* Send. */ diff --git a/ansel/lib/Ansel.php b/ansel/lib/Ansel.php index b8a27a7d2..dae0b1796 100644 --- a/ansel/lib/Ansel.php +++ b/ansel/lib/Ansel.php @@ -610,7 +610,7 @@ class Ansel // Check for an active image if (!empty($image_id)) { - $text = '' . htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8') . ''; + $text = '' . htmlspecialchars($image->filename) . ''; $nav = $separator . $text . $nav; $levels++; } @@ -635,7 +635,7 @@ class Ansel } if (!empty($owner_title)) { - $owner_title = htmlspecialchars($owner_title, ENT_COMPAT, 'UTF-8'); + $owner_title = htmlspecialchars($owner_title); $levels++; if ($gallery) { $nav = $separator . Ansel::getUrlFor('view', array('view' => 'List', 'groupby' => 'owner', 'owner' => $owner, 'havesearch' => $haveSearch))->link() . $owner_title . '' . $nav; diff --git a/ansel/lib/Block/gallery.php b/ansel/lib/Block/gallery.php index 73e72099e..be2bb44b5 100644 --- a/ansel/lib/Block/gallery.php +++ b/ansel/lib/Block/gallery.php @@ -84,9 +84,7 @@ class Horde_Block_ansel_gallery extends Horde_Block 'slug' => $gallery->get('slug')), true); - return $viewurl->link() - . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') - . ''; + return $viewurl->link() . htmlspecialchars($name) . ''; } /** diff --git a/ansel/lib/Block/my_galleries.php b/ansel/lib/Block/my_galleries.php index 62985af85..42ececa98 100644 --- a/ansel/lib/Block/my_galleries.php +++ b/ansel/lib/Block/my_galleries.php @@ -98,7 +98,7 @@ HEADER; $html .= '' . $url->link(array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");', 'onmouseover' => 'previewImageMg(event, ' . $gallery->getKeyImage(Ansel::getStyleDefinition('ansel_default')) . ');')) - . @htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8') . '' + . htmlspecialchars($gallery->get('name')) . '' . strftime($GLOBALS['prefs']->getValue('date_format'), $gallery->get('last_modified')) . '' . (int)$gallery->countImages(true) . ''; } diff --git a/ansel/lib/Block/recent_comments.php b/ansel/lib/Block/recent_comments.php index 301f3ed4b..8f6b7fdca 100644 --- a/ansel/lib/Block/recent_comments.php +++ b/ansel/lib/Block/recent_comments.php @@ -64,7 +64,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block } // Build the gallery name. if (isset($this->_params['gallery'])) { - $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8'); + $name = htmlspecialchars($gallery->get('name')); } $viewurl = Ansel::getUrlFor('view', array('gallery' => $gallery->id, diff --git a/ansel/lib/Block/recent_faces.php b/ansel/lib/Block/recent_faces.php index c400aa83c..3621506e6 100644 --- a/ansel/lib/Block/recent_faces.php +++ b/ansel/lib/Block/recent_faces.php @@ -52,7 +52,7 @@ class Horde_Block_ansel_recent_faces extends Horde_Block $results = $faces->allFaces(0, $this->_params['limit']); $html = ''; foreach ($results as $face_id => $face) { - $facename = htmlspecialchars($face['face_name'], ENT_COMPAT, 'UTF-8'); + $facename = htmlspecialchars($face['face_name']); $html .= '' . '' . $facename  . ''; diff --git a/ansel/lib/Block/recently_added.php b/ansel/lib/Block/recently_added.php index 793daf143..b2bae650e 100644 --- a/ansel/lib/Block/recently_added.php +++ b/ansel/lib/Block/recently_added.php @@ -68,7 +68,7 @@ class Horde_Block_ansel_recently_added extends Horde_Block return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . ''; } - $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8'); + $name = htmlspecialchars($gallery->get('name')); $style = $gallery->getStyle(); $viewurl = Ansel::getUrlFor('view', array('slug' => $gallery->get('slug'), @@ -144,8 +144,7 @@ HEADER; 'view' => 'Gallery'), true); $galleryLink = $galleryLink->link() - . @htmlspecialchars($gallery->get('name'), ENT_COMPAT, - 'UTF-8') + . htmlspecialchars($gallery->get('name')) . ''; $caption = substr($image->caption, 0, 30); @@ -166,9 +165,7 @@ HEADER; . $url->link( array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");', 'onmouseover' => 'previewImage(event, ' . $image->id . ');')) - . @htmlspecialchars( - strlen($caption) ? $caption : $image->filename, - ENT_COMPAT, 'UTF-8') + . htmlspecialchars(strlen($caption) ? $caption : $image->filename) . '' . $galleryLink . ''; } $html .= ''; diff --git a/ansel/lib/GalleryMode/Date.php b/ansel/lib/GalleryMode/Date.php index 54bd0a2fd..1c732d804 100644 --- a/ansel/lib/GalleryMode/Date.php +++ b/ansel/lib/GalleryMode/Date.php @@ -111,7 +111,7 @@ class Ansel_GalleryMode_Date extends Ansel_GalleryMode_Base $trail[] = array('title' => _("All dates"), 'navdata' => $navdata); } - $text = htmlspecialchars($this->_gallery->get('name'), ENT_COMPAT, 'UTF-8'); + $text = htmlspecialchars($this->_gallery->get('name')); $navdata = array('view' => 'Gallery', 'gallery' => $this->_gallery->id, 'slug' => $this->_gallery->get('slug')); diff --git a/ansel/lib/Image.php b/ansel/lib/Image.php index 5684c55bf..f97d5021b 100644 --- a/ansel/lib/Image.php +++ b/ansel/lib/Image.php @@ -1206,7 +1206,7 @@ class Ansel_Image Implements Iterator $output[$field] = $value; } else { $description = isset($data['description']) ? $data['description'] : $field; - $output[] = '' . $description . '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ''; + $output[] = '' . $description . '' . htmlspecialchars($value) . ''; } } diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index 442203f65..14887513b 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -899,7 +899,7 @@ class Ansel_Storage if ($galleries[$gallery_id]['perm']) { $data = array((string)Ansel::getImageUrl($image->id, $image_view, $full, $style), - htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8'), + htmlspecialchars($image->filename), $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)), $image->id, 0); @@ -925,10 +925,10 @@ class Ansel_Storage } if (count($json)) { - return Horde_Serialize::serialize($json, Horde_Serialize::JSON, 'UTF-8'); - } else { - return ''; + return Horde_Serialize::serialize($json, Horde_Serialize::JSON); } + + return ''; } /** diff --git a/ansel/lib/Tile/DateGallery.php b/ansel/lib/Tile/DateGallery.php index 8873b5955..be60f1d12 100644 --- a/ansel/lib/Tile/DateGallery.php +++ b/ansel/lib/Tile/DateGallery.php @@ -104,7 +104,7 @@ class Ansel_Tile_DateGallery /* Variables used in the template file */ $image_link = $view_link . $gallery_image . ''; - $text_link = $view_link . htmlspecialchars($caption, ENT_COMPAT, 'UTF-8') . ''; + $text_link = $view_link . htmlspecialchars($caption) . ''; $gallery_count = $dgallery->countImages(true); /* Background color is needed if displaying a mini tile */ diff --git a/ansel/lib/Tile/Gallery.php b/ansel/lib/Tile/Gallery.php index 4e5217d0f..333d4f17b 100644 --- a/ansel/lib/Tile/Gallery.php +++ b/ansel/lib/Tile/Gallery.php @@ -77,7 +77,7 @@ class Ansel_Tile_Gallery } $image_link = $view_link . $gallery_image . ''; - $text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8') + $text_link = $view_link . htmlspecialchars($gallery->get('name')) . ''; if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) && !$mini) { @@ -101,7 +101,7 @@ class Ansel_Tile_Gallery if (empty($owner_string)) { $owner_string = $gallery->get('owner'); } - $owner_link .= htmlspecialchars($owner_string, ENT_COMPAT, 'UTF-8') . ''; + $owner_link .= htmlspecialchars($owner_string) . ''; } $gallery_count = $gallery->countImages(true); diff --git a/ansel/lib/View/Base.php b/ansel/lib/View/Base.php index edb21eb54..85dc5334f 100644 --- a/ansel/lib/View/Base.php +++ b/ansel/lib/View/Base.php @@ -264,7 +264,7 @@ abstract class Ansel_View_Base } $data = array((string)Ansel::getImageUrl($image->id, $params['image_view'], $params['full'], $style), - htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8'), + htmlspecialchars($image->filename), $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)), $image->id, $curpage); @@ -286,7 +286,7 @@ abstract class Ansel_View_Base $json[] = $data; } - return Horde_Serialize::serialize($json, Horde_Serialize::JSON, 'UTF-8'); + return Horde_Serialize::serialize($json, Horde_Serialize::JSON); } /** diff --git a/ansel/lib/Widget/Links.php b/ansel/lib/Widget/Links.php index 167a27873..bcdd488ed 100644 --- a/ansel/lib/Widget/Links.php +++ b/ansel/lib/Widget/Links.php @@ -24,7 +24,7 @@ class Ansel_Widget_Links extends Ansel_Widget_Base $html = $this->_htmlBegin(); $html .= Ansel::getUrlFor('rss_user', array('owner' => $owner))->link() . Horde::img('feed.png') . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . ''; $slug = $this->_view->gallery->get('slug'); - $html .= '
' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' . Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, 'UTF-8')) . ''; + $html .= '
' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' . Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'))) . ''; /* Embed html */ if (empty($this->_view->_params['image_id'])) { diff --git a/ansel/rss.php b/ansel/rss.php index 70f18e976..573976a82 100644 --- a/ansel/rss.php +++ b/ansel/rss.php @@ -263,10 +263,9 @@ if (empty($rss)) { } } - $charset = 'UTF-8'; $xsl = $registry->get('themesuri') . '/feed-rss.xsl'; - $stream_name = @htmlspecialchars($params['name'], ENT_COMPAT, 'UTF-8'); - $stream_desc = @htmlspecialchars($params['desc'], ENT_COMPAT, 'UTF-8'); + $stream_name = htmlspecialchars($params['name']); + $stream_desc = htmlspecialchars($params['desc']); $stream_updated = htmlspecialchars(date('r', $params['last_modified'])); $stream_official = htmlspecialchars($params['link']); $image_url = htmlspecialchars($params['image_url']); diff --git a/ansel/templates/captions/captions.inc b/ansel/templates/captions/captions.inc index 39f2755bb..3aa7c6bbc 100644 --- a/ansel/templates/captions/captions.inc +++ b/ansel/templates/captions/captions.inc @@ -7,7 +7,7 @@

- +

get('desc')): ?> @@ -33,7 +33,7 @@ if ($gallery->countImages()) { echo ''; echo '' . htmlspecialchars($image->filename) . '' . ''; + htmlspecialchars($image->caption) . ''; $count++; if (($count % 2) == 0) { diff --git a/ansel/templates/common-header.inc b/ansel/templates/common-header.inc index 72c02d322..211891131 100644 --- a/ansel/templates/common-header.inc +++ b/ansel/templates/common-header.inc @@ -1,6 +1,6 @@ @@ -21,7 +21,7 @@ Horde::outputMetaTags(); Horde::includeScriptFiles(); ?> -<?php echo htmlspecialchars($page_title, ENT_COMPAT, 'UTF-8') ?> +<?php echo htmlspecialchars($page_title) ?> diff --git a/ansel/templates/faces/gallery.inc b/ansel/templates/faces/gallery.inc index 12a6c14b4..f73040a69 100644 --- a/ansel/templates/faces/gallery.inc +++ b/ansel/templates/faces/gallery.inc @@ -32,7 +32,7 @@ render() ?> -

+

+

+

copy()->add(array_merge( diff --git a/ansel/templates/image/preview_image.inc b/ansel/templates/image/preview_image.inc index d4063b16f..af77e34bc 100644 --- a/ansel/templates/image/preview_image.inc +++ b/ansel/templates/image/preview_image.inc @@ -1,4 +1,4 @@ -

+

add( array_merge( diff --git a/ansel/templates/image/resize_image.inc b/ansel/templates/image/resize_image.inc index 0e6ef7b07..b86303c96 100644 --- a/ansel/templates/image/resize_image.inc +++ b/ansel/templates/image/resize_image.inc @@ -29,7 +29,7 @@ function resetImage() document.slider.setValue(); } -

+

- link(array('title' => _("Refresh List"))) . Horde::img('reload.png', _("Refresh List")) . '' ?> + link(array('title' => _("Refresh List"))) . Horde::img('reload.png', _("Refresh List")) . '' ?>
diff --git a/ansel/templates/view/results.inc b/ansel/templates/view/results.inc index e7d9c89e1..d23150994 100644 --- a/ansel/templates/view/results.inc +++ b/ansel/templates/view/results.inc @@ -66,7 +66,7 @@ $allLink = (!empty($this->_owner)) ? Horde::selfUrl()->add(array('view' => 'Resu if ($total) { echo '' . ($total > $this->_perPage ? sprintf(_("%d to %d of %d Items"), $this->_pagestart, $this->_pageend, $total) : sprintf(ngettext("%d Item", "%d Items", $total), $total)) . '' . $allLink . ''; } -echo htmlspecialchars($this->getTitle(), ENT_COMPAT, 'UTF-8') . $this->_search->getTagTrail(); +echo htmlspecialchars($this->getTitle()) . $this->_search->getTagTrail(); ?> diff --git a/ansel/templates/xppublish/new.inc b/ansel/templates/xppublish/new.inc index f42255dcc..a45f14dea 100755 --- a/ansel/templates/xppublish/new.inc +++ b/ansel/templates/xppublish/new.inc @@ -21,7 +21,7 @@
- +
diff --git a/babel/templates/common-header.inc b/babel/templates/common-header.inc index bd2626d99..eaa3d5bc4 100644 --- a/babel/templates/common-header.inc +++ b/babel/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/chora/templates/common-header.inc b/chora/templates/common-header.inc index 7be23e4a1..24995b7a3 100644 --- a/chora/templates/common-header.inc +++ b/chora/templates/common-header.inc @@ -1,6 +1,6 @@ @@ -16,7 +16,7 @@ if (!empty($title)) { Horde::outputMetaTags(); if (Horde_Util::nonInputVar('js_vars')) { - Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, 'UTF-8')); + Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON)); } Horde::includeScriptFiles(); diff --git a/crumb/templates/common-header.inc b/crumb/templates/common-header.inc index 1ad6d3968..86b9c2aad 100644 --- a/crumb/templates/common-header.inc +++ b/crumb/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/drag_n_drop_portal/block.php b/drag_n_drop_portal/block.php index e27b2aefa..71c537bbe 100644 --- a/drag_n_drop_portal/block.php +++ b/drag_n_drop_portal/block.php @@ -34,4 +34,4 @@ if ($block instanceof PEAR_Error) { } } -echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, 'UTF-8'); +echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON); diff --git a/drag_n_drop_portal/lib/Block/Layout/View/js.php b/drag_n_drop_portal/lib/Block/Layout/View/js.php index 39a668469..30caa10f4 100644 --- a/drag_n_drop_portal/lib/Block/Layout/View/js.php +++ b/drag_n_drop_portal/lib/Block/Layout/View/js.php @@ -92,9 +92,9 @@ class Horde_Block_Layout_View_Js extends Horde_Block_Layout_View { } } - $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, 'UTF-8'); - $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, 'UTF-8'); - $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, 'UTF-8'); + $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON); + $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON); + $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON); $js_init .= 'portal.add(new Xilinus.Widget().' . 'setTitle(title_' . $js_id .').' diff --git a/fima/postings.php b/fima/postings.php index 5766c364d..3b28ef6e9 100644 --- a/fima/postings.php +++ b/fima/postings.php @@ -662,7 +662,7 @@ if ($pageOb['mode'] == 'edit') { /* Add current date in first field if no postings. */ foreach ($postings as $key => $value) { if ($value['date'] == '') { - $js_onload[] = '$("date1").setValue(' . Horde_Serialize::serialize(strftime($datefmt), Horde_Serialize::JSON, 'UTF-8') . ')'; + $js_onload[] = '$("date1").setValue(' . Horde_Serialize::serialize(strftime($datefmt), Horde_Serialize::JSON) . ')'; } break; } diff --git a/fima/templates/common-header.inc b/fima/templates/common-header.inc index 1dc19c1ca..87fa31c07 100644 --- a/fima/templates/common-header.inc +++ b/fima/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/folks/templates/common-header.inc b/folks/templates/common-header.inc index b35638e91..792811fea 100644 --- a/folks/templates/common-header.inc +++ b/folks/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/folks/templates/feed/activities.php b/folks/templates/feed/activities.php index 6c7d321bb..716685d94 100644 --- a/folks/templates/feed/activities.php +++ b/folks/templates/feed/activities.php @@ -1,4 +1,4 @@ -' ?> +' ?> diff --git a/folks/templates/feed/feed.php b/folks/templates/feed/feed.php index d98eae04d..d060a6bfe 100644 --- a/folks/templates/feed/feed.php +++ b/folks/templates/feed/feed.php @@ -1,4 +1,4 @@ -' ?> +' ?> diff --git a/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php b/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php index 3821cc4ee..4668214ec 100644 --- a/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php +++ b/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php @@ -32,13 +32,6 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler protected $_mail; /** - * The message charset. - * - * @var string - */ - protected $_charset; - - /** * Constructor. * * @param array $params Any parameters that the handler might need. @@ -46,11 +39,10 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler * - identity: An identity factory that implements * getIdentity(). * - mail: A Horde_Mail_Transport instance. - * - charset: The charset of the messages. */ public function __construct(array $params = null) { - foreach (array('identity', 'mail', 'charset') as $param) { + foreach (array('identity', 'mail') as $param) { if (!isset($params[$param])) { throw new Horde_Alarm_Exception('Parameter \'' . $param . '\' missing.'); } @@ -63,7 +55,6 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler } $this->_identity = $params['identity']; $this->_mail = $params['mail']; - $this->_charset = $params['charset']; } /** @@ -93,10 +84,10 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler 'body' => empty($alarm['params']['mail']['body']) ? $alarm['text'] : $alarm['params']['mail']['body'], 'to' => $email, 'from' => $email, - 'charset' => $this->_charset + 'charset' => 'UTF-8' )); $mail->addHeader('Auto-Submitted', 'auto-generated'); - $mail->addHeader('X-Horde-Alarm', $alarm['title'], $this->_charset); + $mail->addHeader('X-Horde-Alarm', $alarm['title'], 'UTF-8'); $mail->send($this->_mail); $alarm['internal']['mail']['sent'] = true; diff --git a/framework/Alarm/test/Horde/Alarm/SqlTest.php b/framework/Alarm/test/Horde/Alarm/SqlTest.php index 5af5341a2..a300ee624 100644 --- a/framework/Alarm/test/Horde/Alarm/SqlTest.php +++ b/framework/Alarm/test/Horde/Alarm/SqlTest.php @@ -9,6 +9,7 @@ class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase { + protected static $skip = false; protected static $pearConf; protected static $db; protected static $migrator; @@ -32,7 +33,7 @@ class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase require $config; } if (!isset($conf['alarm']['test'])) { - self::markTestSkipped('No configuration for Horde_Alarm test.'); + self::$skip = true; return; } @@ -48,7 +49,16 @@ class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase public static function tearDownAfterClass() { - self::$migrator->down(); + if (self::$migrator) { + self::$migrator->down(); + } + } + + public function setUp() + { + if (self::$skip) { + $this->markTestSkipped('No configuration for Horde_Alarm test.'); + } } public function testFactory() diff --git a/framework/Block/lib/Horde/Block/Layout/Manager.php b/framework/Block/lib/Horde/Block/Layout/Manager.php index 0be4f4e11..9cb763562 100644 --- a/framework/Block/lib/Horde/Block/Layout/Manager.php +++ b/framework/Block/lib/Horde/Block/Layout/Manager.php @@ -241,7 +241,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout try { $message = Horde::callHook('perms_denied', array('horde:max_blocks')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks)); } $GLOBALS['notification']->push($message, 'horde.error', array('content.raw')); break; diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 745db8dc7..946b0d17d 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -555,8 +555,6 @@ HTML; */ static public function sendHTTPResponse($data, $ct) { - $charset = 'UTF-8'; - // Output headers and encoded response. switch ($ct) { case 'json': @@ -574,13 +572,13 @@ HTML; * * Finally, add prototypejs security delimiters to returned * JSON. */ - $s_data = Horde_String::convertCharset(str_replace("\00", '', self::escapeJson($data, array('charset' => $charset))), $charset, 'UTF-8'); + $s_data = str_replace("\00", '', self::escapeJson($data)); if ($ct == 'json') { header('Content-Type: application/json'); echo $s_data; } else { - header('Content-Type: text/html; charset=' . $charset); + header('Content-Type: text/html; charset=UTF-8'); echo htmlspecialchars($s_data); } break; @@ -589,7 +587,7 @@ HTML; case 'plain': case 'xml': $s_data = is_string($data) ? $data : $data->response; - header('Content-Type: text/' . $ct . '; charset=' . $charset); + header('Content-Type: text/' . $ct . '; charset=UTF-8'); echo $s_data; break; @@ -606,8 +604,6 @@ HTML; * @param mixed $data The data to JSON-ify. * @param array $options Additional options: *
-     * 'charset' - (string) The charset of $data.
-     *             DEFAULT: Horde_Registry::getCharset()
      * 'nodelimit' - (boolean) Don't add security delimiters?
      *               DEFAULT: false
      * 'urlencode' - (boolean) URL encode the json string
@@ -618,7 +614,7 @@ HTML;
      */
     static public function escapeJson($data, array $options = array())
     {
-        $json = Horde_Serialize::serialize($data, Horde_Serialize::JSON, empty($options['charset']) ? 'UTF-8' : $options['charset']);
+        $json = Horde_Serialize::serialize($data, Horde_Serialize::JSON);
         if (empty($options['nodelimit'])) {
             $json = '/*-secure-' . $json . '*/';
         }
@@ -1135,16 +1131,9 @@ HTML;
         }
         if (!empty($title)) {
             if ($escape) {
-                $charset = 'UTF-8';
-                $old_error = error_reporting(0);
                 $title = str_replace(
                     array("\r", "\n"), '',
-                    htmlspecialchars(
-                        nl2br(htmlspecialchars($title, ENT_QUOTES, $charset)),
-                        ENT_QUOTES, $charset));
-
-                error_reporting($old_error);
-
+                    htmlspecialchars(nl2br(htmlspecialchars($title))));
                 /* Remove double encoded entities. */
                 $title = preg_replace('/&([a-z]+|(#\d+));/i', '&\\1;', $title);
             }
@@ -1176,9 +1165,7 @@ HTML;
                                        $attributes = array())
     {
         if (!empty($title)) {
-            $charset = 'UTF-8';
-            $old_error = error_reporting(0);
-            $title = '<pre>' . preg_replace(array('/\n/', '/((?))/em', '/

/', '/
/'), array('', 'str_repeat(" ", strlen("$1"))', '<br /> <br />', '<br />'), nl2br(htmlspecialchars(htmlspecialchars($title, ENT_QUOTES, $charset), ENT_QUOTES, $charset))) . '</pre>'; + $title = '<pre>' . preg_replace(array('/\n/', '/((?))/em', '/

/', '/
/'), array('', 'str_repeat(" ", strlen("$1"))', '<br /> <br />', '<br />'), nl2br(htmlspecialchars(htmlspecialchars($title)))) . '</pre>'; error_reporting($old_error); self::addScriptFile('tooltips.js', 'horde'); @@ -1276,11 +1263,9 @@ HTML; */ static public function img($src, $alt = '', $attr = '') { - $charset = 'UTF-8'; - /* If browser does not support images, simply return the ALT text. */ if (!$GLOBALS['browser']->hasFeature('images')) { - return @htmlspecialchars($alt, ENT_COMPAT, $charset); + return htmlspecialchars($alt); } /* If no directory has been specified, get it from the registry. */ @@ -1297,7 +1282,7 @@ HTML; $img = ' $value) { - $img .= ' ' . $attribute . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"'; + $img .= ' ' . $attribute . '="' . htmlspecialchars($value) . '"'; } error_reporting($old_error); @@ -1319,11 +1304,9 @@ HTML; */ static public function fullSrcImg($src, $options = array()) { - $charset = 'UTF-8'; - /* If browser does not support images, simply return the ALT text. */ if (!$GLOBALS['browser']->hasFeature('images')) { - return @htmlspecialchars($alt, ENT_COMPAT, $charset); + return htmlspecialchars($alt); } /* If no directory has been specified, get it from the registry. */ @@ -1341,11 +1324,9 @@ HTML; if (!empty($options['attr'])) { /* Build all of the tag attributes. */ if (is_array($options['attr'])) { - $old_error = error_reporting(0); foreach ($options['attr'] as $attribute => $value) { - $img .= ' ' . $attribute . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"'; + $img .= ' ' . $attribute . '="' . htmlspecialchars($value) . '"'; } - error_reporting($old_error); } /* If the user supplied a pre-built string of attributes, add * that. */ @@ -1601,10 +1582,7 @@ HTML; if (isset($GLOBALS['registry']->nlsconfig['multibyte'][$GLOBALS['registry']->getLanguageCharset()])) { /* Prefix parenthesis with the UTF-8 representation of the LRO * (Left-to-Right-Override) Unicode codepoint U+202D. */ - $prefix = ('UTF-8' == 'UTF-8') - ? "\xe2\x80\xad" - : ''; - return $stripped_label . $prefix . '(' + return $stripped_label . "\xe2\x80\xad" . '(' . strtoupper($accessKey) . '' . ')'; } @@ -1801,14 +1779,13 @@ HTML; */ static public function addInlineJsVars($data, $ret = false, $onload = null) { - $charset = 'UTF-8'; $out = array(); foreach ($data as $key => $val) { if ($key[0] == '-') { $key = substr($key, 1); } else { - $val = Horde_Serialize::serialize($val, Horde_Serialize::JSON, $charset); + $val = Horde_Serialize::serialize($val, Horde_Serialize::JSON); } $out[] = $key . '=' . $val; diff --git a/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php b/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php index 32c5c467a..b72ccbfd5 100644 --- a/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php +++ b/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php @@ -73,7 +73,7 @@ class Horde_Core_Ajax_Imple_SpellChecker extends Horde_Core_Ajax_Imple } Horde::addInlineScript(array( - $this->_params['id'] . ' = new SpellChecker(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, 'UTF-8') . ')' + $this->_params['id'] . ' = new SpellChecker(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON) . ')' ), 'dom'); } diff --git a/framework/Core/lib/Horde/Core/Auth/Signup/Base.php b/framework/Core/lib/Horde/Core/Auth/Signup/Base.php index 016f7fa3c..6bfd76b29 100644 --- a/framework/Core/lib/Horde/Core/Auth/Signup/Base.php +++ b/framework/Core/lib/Horde/Core/Auth/Signup/Base.php @@ -89,7 +89,7 @@ abstract class Horde_Core_Auth_Signup_Base 'body' => $message, 'to' => $conf['signup']['email'], 'from' => $conf['signup']['email'], - 'subject' => 'UTF-8')); + 'charset' => 'UTF-8')); $mail->send($GLOBALS['injector']->getInstance('Horde_Mail')); } } diff --git a/framework/Core/lib/Horde/Core/Factory/Alarm.php b/framework/Core/lib/Horde/Core/Factory/Alarm.php index a8bbc47aa..a4e6a909b 100644 --- a/framework/Core/lib/Horde/Core/Factory/Alarm.php +++ b/framework/Core/lib/Horde/Core/Factory/Alarm.php @@ -70,7 +70,6 @@ class Horde_Core_Factory_Alarm $handler_params = array( 'identity' => $injector->getInstance('Horde_Prefs_Identity'), 'mail' => $injector->getInstance('Horde_Mail'), - 'charset' => 'UTF-8' ); $alarm->addHandler('mail', new Horde_Alarm_Handler_Mail($handler_params)); diff --git a/framework/Core/lib/Horde/Core/Factory/Crypt.php b/framework/Core/lib/Horde/Core/Factory/Crypt.php index 14d2b0a63..d61317fa2 100644 --- a/framework/Core/lib/Horde/Core/Factory/Crypt.php +++ b/framework/Core/lib/Horde/Core/Factory/Crypt.php @@ -58,7 +58,6 @@ class Horde_Core_Factory_Crypt global $registry; $params = array_merge(array( - 'charset' => 'UTF-8', 'email_charset' => $registry->getEmailCharset(), 'temp' => Horde::getTempDir() ), $params); diff --git a/framework/Core/lib/Horde/Core/Factory/TextFilter.php b/framework/Core/lib/Horde/Core/Factory/TextFilter.php index cdc8355bd..330f119a6 100644 --- a/framework/Core/lib/Horde/Core/Factory/TextFilter.php +++ b/framework/Core/lib/Horde/Core/Factory/TextFilter.php @@ -138,18 +138,6 @@ class Horde_Core_Factory_TextFilter break; } - /* Add charset information, if needed. */ - if (!isset($params['charset'])) { - switch ($lc_driver) { - case 'cleanhtml': - case 'html2text': - case 'space2html': - case 'text2html': - $params['charset'] = 'UTF-8'; - break; - } - } - return array($driver, $params); } diff --git a/framework/Core/lib/Horde/Core/Prefs/Identity.php b/framework/Core/lib/Horde/Core/Prefs/Identity.php index ab66ec8d9..94d2c83f8 100644 --- a/framework/Core/lib/Horde/Core/Prefs/Identity.php +++ b/framework/Core/lib/Horde/Core/Prefs/Identity.php @@ -55,7 +55,7 @@ class Horde_Core_Prefs_Identity extends Horde_Prefs_Identity $body = new Horde_Mime_Part(); $body->setType('text/plain'); - $body->setContents(Horde_String::wrap($message, 76, "\n")); + $body->setContents(Horde_String::wrap($message, 76)); $body->setCharset('UTF-8'); $body->send($new_addr, $msg_headers, $GLOBALS['injector']->getInstance('Horde_Mail')); diff --git a/framework/Core/lib/Horde/Core/Prefs/Ui.php b/framework/Core/lib/Horde/Core/Prefs/Ui.php index 46e7ae673..8577ba6e9 100644 --- a/framework/Core/lib/Horde/Core/Prefs/Ui.php +++ b/framework/Core/lib/Horde/Core/Prefs/Ui.php @@ -774,7 +774,7 @@ class Horde_Core_Prefs_Ui // Fall-through default: - $val2 = Horde_String::convertCharset($val, 'UTF-8', 'UTF-8'); + $val2 = $val; } // [0] = pref name diff --git a/framework/Core/lib/Horde/Core/Tree/Javascript.php b/framework/Core/lib/Horde/Core/Tree/Javascript.php index 52201d15f..ee6d01728 100644 --- a/framework/Core/lib/Horde/Core/Tree/Javascript.php +++ b/framework/Core/lib/Horde/Core/Tree/Javascript.php @@ -103,7 +103,7 @@ class Horde_Core_Tree_Javascript extends Horde_Core_Tree_Html } Horde::addInlineScript(array( - 'window.' . $js_var . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, 'UTF-8') . ')' + 'window.' . $js_var . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON) . ')' ), 'dom'); return '
'; diff --git a/framework/Core/lib/Horde/Core/Ui/VarRenderer.php b/framework/Core/lib/Horde/Core/Ui/VarRenderer.php index 2bf8d8433..bcb31bb54 100644 --- a/framework/Core/lib/Horde/Core/Ui/VarRenderer.php +++ b/framework/Core/lib/Horde/Core/Ui/VarRenderer.php @@ -23,13 +23,6 @@ class Horde_Core_Ui_VarRenderer protected $_params; /** - * Charset to use for output. - * - * @var string - */ - protected $_charset; - - /** * Constructs a new renderer. * * @param array $params The name of the variable which will track this UI @@ -38,7 +31,6 @@ class Horde_Core_Ui_VarRenderer public function __construct($params = array()) { $this->_params = $params; - $this->_charset = 'UTF-8'; } /** diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 4543cc034..b46fa833e 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -2317,15 +2317,11 @@ class Horde_Registry * @param string $app The application name. * @param string $directory The directory where the application's * LC_MESSAGES directory resides. - * @param string $charset The charset. */ - public function setTextdomain($app, $directory, $charset = 'UTF-8') + public function setTextdomain($app, $directory) { bindtextdomain($app, $directory); textdomain($app); - if (!Horde::contentSent()) { - header('Content-Type: text/html; charset=' . $charset); - } } /** diff --git a/framework/Crypt/lib/Horde/Crypt.php b/framework/Crypt/lib/Horde/Crypt.php index 46b7e0f2b..09ba76240 100644 --- a/framework/Crypt/lib/Horde/Crypt.php +++ b/framework/Crypt/lib/Horde/Crypt.php @@ -67,8 +67,6 @@ class Horde_Crypt * * @param array $params Configuration parameters: *
-     * 'charset' - (string) The default charset.
-     *             DEFAULT: NONE
      * 'email_charset' - (string) The default email charset.
      *                   DEFAULT: NONE
      * 'temp' - (string) [REQUIRED] Location of temporary directory.
@@ -85,7 +83,6 @@ class Horde_Crypt
         $this->_tempdir = Horde_Util::createTempDir(true, $params['temp']);
 
         $this->_params = array_merge(array(
-            'charset' => null,
             'email_charset' => null,
         ), $params);
     }
diff --git a/framework/Crypt/lib/Horde/Crypt/Pgp.php b/framework/Crypt/lib/Horde/Crypt/Pgp.php
index ff41e75e1..2f0135167 100644
--- a/framework/Crypt/lib/Horde/Crypt/Pgp.php
+++ b/framework/Crypt/lib/Horde/Crypt/Pgp.php
@@ -1327,7 +1327,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
             '--armor',
             '--always-trust',
             '--batch',
-            '--charset ' . $this->_params['charset'],
+            '--charset UTF-8',
             $keyring,
             '--verify'
         );
@@ -1403,7 +1403,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $pgp_sign->setType('application/pgp-signature');
         $pgp_sign->setCharset($this->_params['email_charset']);
         $pgp_sign->setDisposition('inline');
-        $pgp_sign->setDescription(Horde_String::convertCharset(_("PGP Digital Signature"), $this->_params['charset'], $this->_params['email_charset']));
+        $pgp_sign->setDescription(Horde_String::convertCharset(_("PGP Digital Signature"), 'UTF-8', $this->_params['email_charset']));
         $pgp_sign->setContents($msg_sign, array('encoding' => '7bit'));
 
         /* Get the algorithim information from the signature. Since we are
@@ -1447,7 +1447,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part->setType('multipart/encrypted');
         $part->setCharset($this->_params['email_charset']);
         $part->setContentTypeParameter('protocol', 'application/pgp-encrypted');
-        $part->setDescription(Horde_String::convertCharset(_("PGP Encrypted Data"), $this->_params['charset'], $this->_params['email_charset']));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Encrypted Data"), 'UTF-8', $this->_params['email_charset']));
         $part->setContents("This message is in MIME format and has been PGP encrypted.\n");
 
         $part1 = new Horde_Mime_Part();
@@ -1490,7 +1490,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part->setContents("This message is in MIME format and has been PGP signed and encrypted.\n");
 
         $part->setCharset($this->_params['email_charset']);
-        $part->setDescription(Horde_String::convertCharset(_("PGP Signed/Encrypted Data"), $this->_params['charset'], $this->_params['email_charset']));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Signed/Encrypted Data"), 'UTF-8', $this->_params['email_charset']));
 
         return $part;
     }
@@ -1508,7 +1508,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part = new Horde_Mime_Part();
         $part->setType('application/pgp-keys');
         $part->setCharset($this->_params['email_charset']);
-        $part->setDescription(Horde_String::convertCharset(_("PGP Public Key"), $this->_params['charset'], $this->_params['charset']));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Public Key"), 'UTF-8', $this->_params['email_charset']));
         $part->setContents($key, array('encoding' => '7bit'));
 
         return $part;
diff --git a/framework/Crypt/lib/Horde/Crypt/Smime.php b/framework/Crypt/lib/Horde/Crypt/Smime.php
index 4a27a7623..a05217f27 100644
--- a/framework/Crypt/lib/Horde/Crypt/Smime.php
+++ b/framework/Crypt/lib/Horde/Crypt/Smime.php
@@ -280,7 +280,7 @@ class Horde_Crypt_Smime extends Horde_Crypt
 
         $msg = new Horde_Mime_Part();
         $msg->setCharset($this->_params['email_charset']);
-        $msg->setDescription(Horde_String::convertCharset(_("S/MIME Encrypted Message"), $this->_params['charset'], $this->_params['email_charset']));
+        $msg->setDescription(Horde_String::convertCharset(_("S/MIME Encrypted Message"), 'UTF-8', $this->_params['email_charset']));
         $msg->setDisposition('inline');
         $msg->setType('application/pkcs7-mime');
         $msg->setContentTypeParameter('smime-type', 'enveloped-data');
diff --git a/framework/DataTree/DataTree/sql.php b/framework/DataTree/DataTree/sql.php
index 004619ae8..aee91f9f6 100644
--- a/framework/DataTree/DataTree/sql.php
+++ b/framework/DataTree/DataTree/sql.php
@@ -450,8 +450,7 @@ class DataTree_sql extends DataTree {
         if (is_a($name, 'PEAR_Error')) {
             return null;
         } else {
-            $name = Horde_String::convertCharset($name, $this->_params['charset'],
-                                           'UTF-8');
+            $name = Horde_String::convertCharset($name, $this->_params['charset'], 'UTF-8');
             // Get the parent names, if any.
             $parent = $this->getParentById($id);
             if ($parent && !is_a($parent, 'PEAR_Error') &&
@@ -1019,7 +1018,7 @@ class DataTree_sql extends DataTree {
                 /* Convert old data to the new format. */
                 if ($row[1] == Horde_Serialize::BASIC) {
                     $data[$id] = Horde_String::convertCharset($data[$id],
-                                                        $GLOBALS['registry']->getLanguageCharset());
+                                                              $GLOBALS['registry']->getLanguageCharset());
                 }
 
                 $data[$id] = (is_null($data[$id]) || !is_array($data[$id]))
@@ -1103,8 +1102,8 @@ class DataTree_sql extends DataTree {
             $rows = $this->_db->getAll($query, DB_FETCHMODE_ASSOC);
             for ($i = 0; $i < count($rows); $i++) {
                 $rows[$i]['value'] = Horde_String::convertCharset($rows[$i]['value'],
-                                                            $this->_params['charset'],
-                                                            'UTF-8');
+                                                                  $this->_params['charset'],
+                                                                  'UTF-8');
             }
             return $rows;
         }
diff --git a/framework/Date/test/Horde/Date/RecurrenceTest.php b/framework/Date/test/Horde/Date/RecurrenceTest.php
index 45d18c840..6c49aba7d 100644
--- a/framework/Date/test/Horde/Date/RecurrenceTest.php
+++ b/framework/Date/test/Horde/Date/RecurrenceTest.php
@@ -21,7 +21,6 @@ class Horde_Date_RecurrenceTest extends PHPUnit_Framework_TestCase
 {
     protected function setUp()
     {
-        Horde_String::setDefaultCharset('UTF-8');
         $this->ical = new Horde_Icalendar();
         $this->_oldTimezone = date_default_timezone_get();
         date_default_timezone_set('Europe/Berlin');
diff --git a/framework/Form/Form/Renderer.php b/framework/Form/Form/Renderer.php
index 667a7723a..4b2128939 100644
--- a/framework/Form/Form/Renderer.php
+++ b/framework/Form/Form/Renderer.php
@@ -213,7 +213,7 @@ try {
                 }
             }
         }
-        echo '';
+        echo '';
     }
 
     function renderFormActive(&$form, &$vars)
diff --git a/framework/Group/lib/Horde/Group/Kolab.php b/framework/Group/lib/Horde/Group/Kolab.php
index 1fcd03b56..a9213f832 100644
--- a/framework/Group/lib/Horde/Group/Kolab.php
+++ b/framework/Group/lib/Horde/Group/Kolab.php
@@ -304,10 +304,8 @@ class Horde_Group_Kolab extends Horde_Group_Ldap
             }
 
             $groups = array();
-            $current_charset = 'UTF-8';
             for ($i = 0; $i < $result['count']; $i++) {
-                $utf8_dn = Horde_String::convertCharset($result[$i]['dn'], 'UTF-8', $current_charset);
-                $groups[$utf8_dn] = $this->getGroupName($utf8_dn);
+                $groups[$result[$i]['dn']] = $this->getGroupName($result[$i]['dn']);
             }
 
             $cache[$user] = $groups;
diff --git a/framework/Group/lib/Horde/Group/Ldap.php b/framework/Group/lib/Horde/Group/Ldap.php
index f91cec5ac..486229dc8 100644
--- a/framework/Group/lib/Horde/Group/Ldap.php
+++ b/framework/Group/lib/Horde/Group/Ldap.php
@@ -280,7 +280,6 @@ class Horde_Group_Ldap extends Horde_Group
      */
     public function getGroupName($dn)
     {
-        $dn = Horde_String::convertCharset($dn, 'UTF-8', 'UTF-8');
         $result = @ldap_explode_dn($dn, 1);
         if ($result === false) {
             throw new Horde_Group_Exception('Invalid group ID passed (bad DN syntax)');
@@ -530,10 +529,8 @@ class Horde_Group_Ldap extends Horde_Group
         }
 
         $this->_userCache[$user] = array();
-        $current_charset = 'UTF-8';
         foreach ($search as $dn => $entry) {
-            $utf8_dn = Horde_String::convertCharset($dn, 'UTF-8', $current_charset);
-            $this->_userCache[$user][$utf8_dn] = $this->getGroupName($utf8_dn);
+            $this->_userCache[$user][$dn] = $this->getGroupName($dn);
         }
 
         return $this->_userCache[$user];
diff --git a/framework/Icalendar/lib/Horde/Icalendar.php b/framework/Icalendar/lib/Horde/Icalendar.php
index 655c7a5ea..8e6713132 100644
--- a/framework/Icalendar/lib/Horde/Icalendar.php
+++ b/framework/Icalendar/lib/Horde/Icalendar.php
@@ -540,20 +540,12 @@ class Horde_Icalendar
      *
      * @param string $text     The data to parse.
      * @param string $base     The type of the base object.
-     * @param string $charset  The encoding charset for $text. Defaults to
-     *                         utf-8 for new format, iso-8859-1 for old format.
-     * @param boolean $clear   If true clears the iCal object before parsing.
      *
      * @return boolean  True on successful import, false otherwise.
      * @throws Horde_Icalendar_Exception
      */
-    public function parsevCalendar($text, $base = 'VCALENDAR',
-                                   $charset = null, $clear = true)
+    public function parsevCalendar($text, $base = 'VCALENDAR')
     {
-        if ($clear) {
-            $this->clear();
-        }
-
         if (preg_match('/^BEGIN:' . $base . '(.*)^END:' . $base . '/ism', $text, $matches)) {
             $container = true;
             $vCal = $matches[1];
@@ -579,7 +571,7 @@ class Horde_Icalendar
                 if ($component === false) {
                     throw new Horde_Icalendar_Exception('Unable to create object for type ' . $type);
                 }
-                $component->parsevCalendar($data, $type, $charset);
+                $component->parsevCalendar($data, $type);
 
                 $this->addComponent($component);
 
@@ -597,7 +589,7 @@ class Horde_Icalendar
                 if ($component === false) {
                     throw new Horde_Icalendar_Exception('Unable to create object for type ' . $type);
                 }
-                $component->parsevCalendar($data, $type, $charset);
+                $component->parsevCalendar($data, $type);
 
                 $this->addComponent($component);
 
@@ -665,15 +657,9 @@ class Horde_Icalendar
                     $value = quoted_printable_decode($value);
                     if (isset($params['CHARSET'])) {
                         $value = Horde_String::convertCharset($value, $params['CHARSET']);
-                    } else {
-                        $value = Horde_String::convertCharset($value, empty($charset) ? ($this->oldFormat ? 'iso-8859-1' : 'utf-8') : $charset);
-                    }
+                     }
                 } elseif (isset($params['CHARSET'])) {
                     $value = Horde_String::convertCharset($value, $params['CHARSET']);
-                } else {
-                    // As per RFC 2279, assume UTF8 if we don't have an
-                    // explicit charset parameter.
-                    $value = Horde_String::convertCharset($value, empty($charset) ? ($this->oldFormat ? 'iso-8859-1' : 'utf-8') : $charset);
                 }
 
                 // Get timezone info for date fields from $params.
@@ -1092,7 +1078,7 @@ class Horde_Icalendar
                 $attr_string = $name . $params_str . ':' . $value;
                 if (!$this->oldFormat) {
                     $attr_string = Horde_String::wordwrap($attr_string, 75, $this->_newline . ' ',
-                                                    true, 'utf-8', true);
+                                                          true, 'utf-8', true);
                 }
                 $result .= $attr_string . $this->_newline;
             }
diff --git a/framework/Icalendar/test/Horde/Icalendar/charset1.phpt b/framework/Icalendar/test/Horde/Icalendar/charset1.phpt
index 1bbd030c2..8aa472d4c 100644
--- a/framework/Icalendar/test/Horde/Icalendar/charset1.phpt
+++ b/framework/Icalendar/test/Horde/Icalendar/charset1.phpt
@@ -40,7 +40,7 @@ STATUS:NEEDS ACTION
 END:VEVENT
 END:VCALENDAR';
 
-$ical->parseVCalendar($data, 'VCALENDAR', 'UTF-8');
+$ical->parseVCalendar($data, 'VCALENDAR');
 $event = $ical->getComponent(0);
 var_dump($event->getAttribute('SUMMARY'));
 
diff --git a/framework/Itip/lib/Horde/Itip/Response.php b/framework/Itip/lib/Horde/Itip/Response.php
index 8f7e83d27..66074c03b 100644
--- a/framework/Itip/lib/Horde/Itip/Response.php
+++ b/framework/Itip/lib/Horde/Itip/Response.php
@@ -188,7 +188,7 @@ class Horde_Itip_Response
         $body = new Horde_Mime_Part();
         $body->setType('text/plain');
         $options->prepareMessageMimePart($body);
-        $body->setContents(Horde_String::wrap($type->getMessage(), 76, "\n"));
+        $body->setContents(Horde_String::wrap($type->getMessage(), 76));
 
         $message->addPart($body);
         $message->addPart($ics);
diff --git a/framework/Kolab/Kolab.php b/framework/Kolab/Kolab.php
index 784c84a05..fd21a3a64 100644
--- a/framework/Kolab/Kolab.php
+++ b/framework/Kolab/Kolab.php
@@ -461,7 +461,7 @@ class Kolab {
             return $default;
         }
 
-        return Horde_String::convertCharset($element->get_content(), 'utf-8');
+        return $element->get_content();
     }
 
     function getVal($name, $default = 0)
@@ -526,7 +526,7 @@ class Kolab {
 
     function &setElemStr(&$parent, $name, $value = '')
     {
-        return $this->setElemVal($parent, $name, Horde_String::convertCharset($value, 'UTF-8', 'utf-8'));
+        return $this->setElemVal($parent, $name, $value);
     }
 
     function &setVal($name, $value = '')
diff --git a/framework/Kolab_Filter/lib/Horde/Kolab/Filter/Configuration.php b/framework/Kolab_Filter/lib/Horde/Kolab/Filter/Configuration.php
index 001a3d630..0896c1d8a 100644
--- a/framework/Kolab_Filter/lib/Horde/Kolab/Filter/Configuration.php
+++ b/framework/Kolab_Filter/lib/Horde/Kolab/Filter/Configuration.php
@@ -111,7 +111,7 @@ class Horde_Kolab_Filter_Configuration
 
         if (!empty($conf['kolab']['filter']['locale_path'])
             && !empty($conf['kolab']['filter']['locale'])) {
-            Horde_Nls::setTextdomain('Kolab_Filter', $conf['kolab']['filter']['locale_path'], Horde_Nls::getCharset());
+            Horde_Nls::setTextdomain('Kolab_Filter', $conf['kolab']['filter']['locale_path']);
             setlocale(LC_ALL, $conf['kolab']['filter']['locale']);
         }
 
diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php
index a7d46bc92..b1abcc5d2 100644
--- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php
+++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php
@@ -775,11 +775,7 @@ class Horde_Kolab_Format_Xml
      */
     protected function _createTextNode($parent, $name, $value)
     {
-        $value = Horde_String::convertCharset($value, 'UTF-8',
-                                              'utf-8');
-
         $node = $this->_xmldoc->createElement($name);
-
         $node = $parent->appendChild($node);
 
         // content
@@ -847,7 +843,7 @@ class Horde_Kolab_Format_Xml
      */
     protected function _getNodeContent($node)
     {
-        return Horde_String::convertCharset($node->textContent, 'utf-8');
+        return $node->textContent;
     }
 
 
diff --git a/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php b/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php
index 5b8dc115c..8fcf83077 100644
--- a/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php
+++ b/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php
@@ -560,7 +560,7 @@ class Kolab_Resource
 
             Horde::logMessage(sprintf('Sending confirmation of cancelation to %s', $organiser), 'WARNING');
 
-            $body = new MIME_Part('text/plain', Horde_String::wrap($body, 76, "\n", 'utf-8'), 'utf-8');
+            $body = new MIME_Part('text/plain', Horde_String::wrap($body, 76));
             $mime = &MIME_Message::convertMimePart($body);
             $mime->setTransferEncoding('quoted-printable');
             $mime->transferEncodeContents();
diff --git a/framework/Kolab_Resource/lib/Horde/Kolab/Resource/Freebusy/Kolab.php b/framework/Kolab_Resource/lib/Horde/Kolab/Resource/Freebusy/Kolab.php
index 23bfcc08b..7e5072d1e 100644
--- a/framework/Kolab_Resource/lib/Horde/Kolab/Resource/Freebusy/Kolab.php
+++ b/framework/Kolab_Resource/lib/Horde/Kolab/Resource/Freebusy/Kolab.php
@@ -95,13 +95,11 @@ class Horde_Kolab_Resource_Freebusy_Kolab extends Horde_Kolab_Resource_Freebusy
         $contentType = $http->getResponseHeader('Content-Type');
         if ($contentType && strpos($contentType, ';') !== false) {
             list(,$charset,) = explode(';', $contentType);
-            $charset         = trim(str_replace('charset=', '', $charset));
-        } else {
-            $charset = 'UTF-8';
+            $vfb_text = Horde_String::convertCharset($vfb_text, trim(str_replace('charset=', '', $charset)), 'UTF-8');
         }
 
         $iCal = new Horde_Icalendar();
-        $iCal->parsevCalendar($vfb_text, 'VCALENDAR', $charset);
+        $iCal->parsevCalendar($vfb_text, 'VCALENDAR');
 
         $vfb = &$iCal->findComponent('VFREEBUSY');
 
diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Namespace.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Namespace.php
index a5780e9d3..808342430 100644
--- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Namespace.php
+++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Namespace.php
@@ -43,13 +43,6 @@ implements Iterator
     protected $_namespaces = array();
 
     /**
-     * The characterset this module uses to communicate with the outside world.
-     *
-     * @var string
-     */
-    protected $_charset;
-
-    /**
      * A prefix in the shared namespaces that will be ignored/removed.
      *
      * @var string
@@ -84,7 +77,6 @@ implements Iterator
      */
     public function __construct()
     {
-        $this->_charset = 'UTF-8';
         if (empty($this->_primaryPersonalNamespace)) {
             $personal = null;
             foreach ($this->_namespaces as $namespace) {
@@ -135,7 +127,7 @@ implements Iterator
      */
     public function getCharset()
     {
-        return $this->_charset;
+        throw new Exception('This method is deprecated, assume UTF-8');
     }
 
     /**
@@ -147,7 +139,7 @@ implements Iterator
      */
     public function getTitle($name)
     {
-        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', $this->_charset);
+        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
         return $this->matchNamespace($name)->getTitle($name);
     }
 
@@ -160,7 +152,7 @@ implements Iterator
      */
     public function getOwner($name)
     {
-        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', $this->_charset);
+        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
         return $this->matchNamespace($name)->getOwner($name);
     }
 
@@ -173,7 +165,7 @@ implements Iterator
      */
     public function getSubpath($name)
     {
-        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', $this->_charset);
+        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
         return $this->matchNamespace($name)->getSubpath($name);
     }
 
@@ -194,7 +186,7 @@ implements Iterator
             array_unshift($path, $this->_primaryPersonalNamespace->getName());
             $namespace = $this->_primaryPersonalNamespace;
         }
-        return Horde_String::convertCharset($namespace->generateName($path), $this->_charset, 'UTF7-IMAP');
+        return Horde_String::convertCharset($namespace->generateName($path), 'UTF-8', 'UTF7-IMAP');
     }
 
     function rewind()
diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Base.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Base.php
index e49342960..dbe98d04f 100644
--- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Base.php
+++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Base.php
@@ -1056,7 +1056,7 @@ implements Horde_Kolab_Storage_Folder
         $part = new Horde_Mime_Part();
         $part->setType('text/plain');
         $part->setName('Kolab Groupware Information');
-        $part->setContents(Horde_String::wrap($kolab_text, 76, "\r\n", 'UTF-8'));
+        $part->setContents(Horde_String::wrap($kolab_text, 76, "\r\n"));
         $part->setCharset('UTF-8');
 
         $part->setTransferEncoding('quoted-printable');
diff --git a/framework/Ldap/test/Horde/Ldap/LdapTest.php b/framework/Ldap/test/Horde/Ldap/LdapTest.php
index f0639d971..a97d0aeb4 100644
--- a/framework/Ldap/test/Horde/Ldap/LdapTest.php
+++ b/framework/Ldap/test/Horde/Ldap/LdapTest.php
@@ -13,6 +13,10 @@ class Horde_Ldap_LdapTest extends Horde_Ldap_TestBase
 {
     public static function tearDownAfterClass()
     {
+        if (!self::$ldapcfg) {
+            return;
+        }
+
         $ldap = new Horde_Ldap(self::$ldapcfg['server']);
         $clean = array('cn=Horde_Ldap_TestEntry,',
                        'ou=Horde_Ldap_Test_subdelete,',
diff --git a/framework/Ldap/test/Horde/Ldap/SearchTest.php b/framework/Ldap/test/Horde/Ldap/SearchTest.php
index 2f711378a..e02afa7db 100644
--- a/framework/Ldap/test/Horde/Ldap/SearchTest.php
+++ b/framework/Ldap/test/Horde/Ldap/SearchTest.php
@@ -13,6 +13,9 @@ class Horde_Ldap_SearchTest extends Horde_Ldap_TestBase
 {
     public static function tearDownAfterClass()
     {
+        if (!self::$ldapcfg) {
+            return;
+        }
         $ldap = new Horde_Ldap(self::$ldapcfg['server']);
         $ldap->delete('ou=Horde_Ldap_Test_search1,' . self::$ldapcfg['server']['basedn']);
         $ldap->delete('ou=Horde_Ldap_Test_search2,' . self::$ldapcfg['server']['basedn']);
diff --git a/framework/Mime/lib/Horde/Mime/Address.php b/framework/Mime/lib/Horde/Mime/Address.php
index 02fd9a125..fa664075e 100644
--- a/framework/Mime/lib/Horde/Mime/Address.php
+++ b/framework/Mime/lib/Horde/Mime/Address.php
@@ -31,8 +31,7 @@ class Horde_Mime_Address
      * @param string $personal  Personal name phrase.
      * @param array $opts  Additional options:
      * 
-     * 'idn' - (boolean) Convert IDN domain names (Punycode/RFC 3490) into
-     *         the local charset.
+     * 'idn' - (boolean) Decode IDN domain names (Punycode/RFC 3490).
      *         Requires the PECL idn module.
      *         DEFAULT: true
      * 
@@ -53,7 +52,7 @@ class Horde_Mime_Address if ((!isset($opts['idn']) || !$opts['idn']) && (stripos($host, 'xn--') === 0) && function_exists('idn_to_utf8')) { - $host = Horde_String::convertCharset(idn_to_utf8($host), 'UTF-8'); + $host = idn_to_utf8($host); } $address .= self::encode($mailbox, 'address') . '@' . $host; diff --git a/framework/Mime/lib/Horde/Mime/Mail.php b/framework/Mime/lib/Horde/Mime/Mail.php index 705c1d79b..4d624ad64 100644 --- a/framework/Mime/lib/Horde/Mime/Mail.php +++ b/framework/Mime/lib/Horde/Mime/Mail.php @@ -205,7 +205,7 @@ class Horde_Mime_Mail public function setBody($body, $charset = 'iso-8859-1', $wrap = false) { if ($wrap) { - $body = Horde_String::wrap($body, $wrap === true ? 76 : $wrap, "\n"); + $body = Horde_String::wrap($body, $wrap === true ? 76 : $wrap); } $this->_body = new Horde_Mime_Part(); $this->_body->setType('text/plain'); diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Syntaxhighlighter.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Syntaxhighlighter.php index 6a75dc305..b7fbe2c51 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Syntaxhighlighter.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Syntaxhighlighter.php @@ -49,10 +49,30 @@ class Horde_Mime_Viewer_Syntaxhighlighter extends Horde_Mime_Viewer_Base $language = $this->_mimeTypeToLanguage($mimeType); $brush = $this->_languageToBrush($language); - $results = '
' . htmlspecialchars($this->_mimepart->getContents(), ENT_QUOTES, $this->getConfigParam('charset')) . '
'; + if (!$this->_shLoaded) { + Horde::addScriptFile('syntaxhighlighter/scripts/shCore.js', 'horde', true); + Horde::addInlineScript(array( + 'SyntaxHighlighter.defaults[\'toolbar\'] = false;', + 'SyntaxHighlighter.all();', + ), 'dom'); + $this->_shLoaded = true; + + $sh_js_fs = $GLOBALS['injector']->getInstance('Horde_Registry')->get('jsfs', 'horde') . '/syntaxhighlighter/styles/'; + $sh_js_uri = Horde::url($GLOBALS['injector']->getInstance('Horde_Registry')->get('jsuri', 'horde'), false, -1) . '/syntaxhighlighter/styles/'; + Horde_Themes::includeStylesheetFiles(array('additional' => array( + array('f' => $sh_js_fs . 'shCoreEclipse.css', 'u' => $sh_js_uri . 'shCoreEclipse.css'), + array('f' => $sh_js_fs . 'shThemeEclipse.css', 'u' => $sh_js_uri . 'shThemeEclipse.css'), + ))); + } + if (empty($this->_shBrushes[$brush])) { + Horde::addScriptFile('syntaxhighlighter/scripts/shBrush' . $brush . '.js', 'horde', true); + $this->_shBrushes[$brush] = true; + } + + $results = '
' . htmlspecialchars($this->_mimepart->getContents()) . '
'; return $this->_renderReturn( $results, - 'text/html; charset=' . $this->getConfigParam('charset') + 'text/html; charset=UTF-8' ); } diff --git a/framework/Model/lib/Horde/Form/Renderer/Xhtml.php b/framework/Model/lib/Horde/Form/Renderer/Xhtml.php index f3bf168ec..5d0d4ce17 100644 --- a/framework/Model/lib/Horde/Form/Renderer/Xhtml.php +++ b/framework/Model/lib/Horde/Form/Renderer/Xhtml.php @@ -131,7 +131,7 @@ if (document.getElementById(%1$s)){ } } echo ''; } diff --git a/framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php b/framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php index 5f7ea305a..f6007753d 100644 --- a/framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php +++ b/framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php @@ -91,7 +91,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer . 'id="%2$s" value="%3$s"%4$s%5$s%6$s />', ($var->isDisabled() ? ' form-input-disabled" ' : ''), $var->getVarName(), - htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'), + htmlspecialchars($var->getValue($vars)), ($var->isDisabled() ? ' disabled="disabled" ' : ''), ($var->type->maxlength ? ' maxlength="' . $var->type->maxlength . '"' : ''), $this->_getActionScripts($form, $var) @@ -113,7 +113,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer return sprintf( '', $var->getVarName(), - htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'), + htmlspecialchars($var->getValue($vars)), ($var->isDisabled() ? ' disabled="disabled" ' : ''), $this->_getActionScripts($form, $var) ); @@ -128,7 +128,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer { return sprintf(' ', $var->getVarName(), - htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'), + htmlspecialchars($var->getValue($vars)), $var->isDisabled() ? ' disabled="disabled" ' : '', $this->_getActionScripts($form, $var) ); @@ -459,7 +459,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer $prompt = $var->type->prompt; $htmlchars = $var->getOption('htmlchars'); if ($prompt) { - $prompt = ''; + $prompt = ''; } return sprintf(' ', $var->getVarName(), @@ -488,7 +488,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer /* Hidden tag to store the current first level. */ $html = sprintf(' ', $varname, - htmlspecialchars($selected['1'], ENT_QUOTES, 'UTF-8')); + htmlspecialchars($selected['1'])); /* First level. */ $values_1 = Horde_Array::valuesToKeys(array_keys($values)); @@ -497,7 +497,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer 'if (this.value) { document.' . $form->getName() . '.formname.value=\'\';' . 'document.' . $form->getName() . '.submit() }', ($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : '')); if (!empty($prompts)) { - $html .= ''; + $html .= ''; } $html .= $this->_selectOptions($values_1, $selected['1']); $html .= ' '; @@ -507,7 +507,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer $varname, ($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : '')); if (!empty($prompts)) { - $html .= ''; + $html .= ''; } $values_2 = array(); if (!empty($selected['1'])) { @@ -778,8 +778,7 @@ EOT; function _renderVarDisplayDefault($form, $var, $vars) { - return nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, - 'UTF-8')); + return nl2br(htmlspecialchars($var->getValue($vars))); } function _renderVarDisplay_html($form, $var, $vars) @@ -823,7 +822,7 @@ EOT; return Horde::link($mail_link, $email_val) . htmlspecialchars($display_email) . ''; } else { - return nl2br(htmlspecialchars($display_email, ENT_QUOTES, 'UTF-8')); + return nl2br(htmlspecialchars($display_email)); } } @@ -854,7 +853,7 @@ EOT; if (count($values) == 0) { return _("No values"); } elseif (isset($values[$value]) && $value != '') { - return htmlspecialchars($values[$value], ENT_QUOTES, 'UTF-8'); + return htmlspecialchars($values[$value]); } } @@ -864,7 +863,7 @@ EOT; if (count($values) == 0) { return _("No values"); } elseif (isset($values[$var->getValue($vars)])) { - return htmlspecialchars($values[$var->getValue($vars)], ENT_QUOTES, 'UTF-8'); + return htmlspecialchars($values[$var->getValue($vars)]); } } @@ -881,7 +880,7 @@ EOT; $display[] = $name; } } - return htmlspecialchars(implode(', ', $display), ENT_QUOTES, 'UTF-8'); + return htmlspecialchars(implode(', ', $display)); } } @@ -898,7 +897,7 @@ EOT; $display[] = $name; } } - return htmlspecialchars(implode(', ', $display), ENT_QUOTES, 'UTF-8'); + return htmlspecialchars(implode(', ', $display)); } } @@ -1069,7 +1068,7 @@ EOT; } } - $html = nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8')); + $html = nl2br(htmlspecialchars($var->getValue($vars))); if (!empty($mapurl)) { $html .= '  ' . Horde::link(Horde::externalUrl($mapurl), $desc, null, '_blank') . Horde::img($icon, $desc) . ''; } @@ -1107,7 +1106,7 @@ EOT; function _renderVarDisplay_invalid($form, $var, $vars) { return '

' - . htmlspecialchars($var->type->message, ENT_QUOTES, 'UTF-8') + . htmlspecialchars($var->type->message) . '

'; } @@ -1226,7 +1225,7 @@ EOT; $selected = ''; } $result .= ' \n"; @@ -1246,7 +1245,7 @@ EOT; $selected = ''; } $result .= " \n"; } diff --git a/framework/Release/lib/Horde/Release.php b/framework/Release/lib/Horde/Release.php index a4d54588c..08741249e 100644 --- a/framework/Release/lib/Horde/Release.php +++ b/framework/Release/lib/Horde/Release.php @@ -656,7 +656,7 @@ class Horde_Release // Building and sending message $mail = new Horde_Mime_Mail(); - $mail->setBody($body, 'utf-8', false); + $mail->setBody($body, 'UTF-8', false); $mail->addHeaders($headers); try { $class = 'Horde_Mail_Transport_' . ucfirst($this->_options['mailer']['type']); diff --git a/framework/Rpc/lib/Horde/Rpc/Webdav.php b/framework/Rpc/lib/Horde/Rpc/Webdav.php index afad383d3..7af46c948 100644 --- a/framework/Rpc/lib/Horde/Rpc/Webdav.php +++ b/framework/Rpc/lib/Horde/Rpc/Webdav.php @@ -182,13 +182,6 @@ class Horde_Rpc_Webdav extends Horde_Rpc var $_http_status = "200 OK"; /** - * encoding of property values passed in - * - * @var string - */ - var $_prop_encoding = "utf-8"; - - /** * Copy of $_SERVER superglobal array * * Derived classes may extend the constructor to @@ -588,7 +581,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc // Handle certain standard properties specially if (in_array('displayname', $properties['DAV:'])) { - $props[] = $this->mkprop('displayname', Horde_String::convertCharset($item['name'], 'UTF-8', 'UTF-8')); + $props[] = $this->mkprop('displayname', $item['name']); unset($properties['DAV:']['displayname']); } if (in_array('getlastmodified', $properties['DAV:'])) { @@ -1535,7 +1528,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc default: $propstats[$i]['D:prop']['D:'. $prop['name']] = $prop['val']; #echo " " - # . $this->_prop_encode(htmlspecialchars($prop['val'])) + # . htmlspecialchars($prop['val']) # . "\n"; break; } @@ -1636,7 +1629,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc if ($responsedescr) { echo " ". - $this->_prop_encode(htmlspecialchars($responsedescr)). + htmlspecialchars($responsedescr). "\n"; } @@ -2783,25 +2776,6 @@ class Horde_Rpc_Webdav extends Horde_Rpc } /** - * UTF-8 encode property values if not already done so - * - * @param string text to encode - * @return string utf-8 encoded text - */ - function _prop_encode($text) - { - switch (strtolower($this->_prop_encoding)) { - case "utf-8": - return $text; - case "iso-8859-1": - case "iso-8859-15": - case "latin-1": - default: - return utf8_encode($text); - } - } - - /** * Slashify - make sure path ends in a slash * * @param string directory path diff --git a/framework/Serialize/lib/Horde/Serialize.php b/framework/Serialize/lib/Horde/Serialize.php index d95c5e36d..3130b2847 100644 --- a/framework/Serialize/lib/Horde/Serialize.php +++ b/framework/Serialize/lib/Horde/Serialize.php @@ -248,11 +248,7 @@ class Horde_Serialize $data = self::serialize($data, array(self::UTF7, self::BASIC), $params); break; - // $params = Source character set case self::JSON: - if (!empty($params)) { - $data = Horde_String::convertCharset($data, $params, 'UTF-8'); - } $tmp = json_encode($data); /* Basic error handling attempts. Requires PHP 5.3+. diff --git a/framework/SpellChecker/lib/Horde/SpellChecker.php b/framework/SpellChecker/lib/Horde/SpellChecker.php index fe892c8f5..d0000f2a5 100644 --- a/framework/SpellChecker/lib/Horde/SpellChecker.php +++ b/framework/SpellChecker/lib/Horde/SpellChecker.php @@ -33,11 +33,6 @@ abstract class Horde_SpellChecker protected $_locale = 'en'; /** - * @var string - */ - protected $_encoding = 'utf-8'; - - /** * @var boolean */ protected $_html = false; diff --git a/framework/SpellChecker/lib/Horde/SpellChecker/Aspell.php b/framework/SpellChecker/lib/Horde/SpellChecker/Aspell.php index 5fca5b6e0..f434e1fc4 100644 --- a/framework/SpellChecker/lib/Horde/SpellChecker/Aspell.php +++ b/framework/SpellChecker/lib/Horde/SpellChecker/Aspell.php @@ -46,13 +46,6 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker throw new Horde_Exception('Spellcheck failed. Command line: ' . $this->_cmd()); } - $charset = 'UTF-8'; - - // Write to stdin. - if ($this->_encoding) { - $input = Horde_String::convertCharset($input, $charset, $this->_encoding); - } - // The '^' character tells aspell to spell check the entire line. fwrite($pipes[0], '^' . $input); fclose($pipes[0]); @@ -76,16 +69,9 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker proc_close($process); if (strlen($out) === 0) { - if ($this->_encoding) { - $err = Horde_String::convertCharset($err, $this->_encoding, $charset); - } throw new Horde_Exception('Spellcheck failed. Command line: ' . $this->_cmd()); } - if ($this->_encoding) { - $out = Horde_String::convertCharset($out, $this->_encoding, $charset); - } - // Parse output. $bad = $suggestions = array(); $lines = explode("\n", $out); @@ -126,7 +112,7 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker */ protected function _cmd() { - $args = ''; + $args = '--encoding=UTF-8'; switch ($this->_suggestMode) { case self::SUGGEST_FAST: @@ -141,17 +127,13 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker $args .= ' --sug-mode=normal'; } - if ($this->_encoding) { - $args .= ' --encoding=' . escapeshellarg($this->_encoding); - } - $args .= ' --lang=' . escapeshellarg($this->_locale); if ($this->_html) { $args .= ' -H'; } - return sprintf('%s -a %s', 'aspell', $args); + return 'aspell -a ' . $args; } } diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php b/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php index 667a43f60..582b610d5 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php @@ -31,7 +31,6 @@ class Horde_Text_Filter_Cleanhtml extends Horde_Text_Filter_Base */ protected $_params = array( 'body_only' => false, - 'charset' => 'us-ascii', 'size' => false ); @@ -62,17 +61,10 @@ class Horde_Text_Filter_Cleanhtml extends Horde_Text_Filter_Base 'wrap' => 0 ); - if (strtolower($this->_params['charset']) == 'us-ascii') { - $tidy = @tidy_parse_string($text, $tidy_config, 'ascii'); - $tidy->cleanRepair(); - $text = tidy_get_output($tidy); - } else { - $tidy = @tidy_parse_string(Horde_String::convertCharset($text, $this->_params['charset'], 'UTF-8'), $tidy_config, 'utf8'); - $tidy->cleanRepair(); - $text = Horde_String::convertCharset(tidy_get_output($tidy), 'UTF-8', $this->_params['charset']); - } + $tidy = @tidy_parse_string($text, $tidy_config, 'utf8'); + $tidy->cleanRepair(); - return $text; + return tidy_get_output($tidy); } } diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php index 693dd014f..a48dd80bb 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php @@ -46,7 +46,6 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base */ protected $_params = array( 'callback' => null, - 'charset' => 'UTF-8', 'width' => 75 ); @@ -94,8 +93,8 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base public function postProcess($text) { try { - $dom = new Horde_Domhtml($text, $this->_params['charset']); - $text = Horde_String::convertCharset($this->_node($dom->dom, $dom->dom), null, $this->_params['charset']); + $dom = new Horde_Domhtml($text, 'UTF-8'); + $text = $this->_node($dom->dom, $dom->dom); $dom_convert = true; } catch (Exception $e) { $text = strip_tags(preg_replace("/\/i", "\n", $text)); @@ -111,7 +110,7 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base if ($dom_convert && $this->_params['_bq'] && class_exists('Horde_Text_Flowed')) { - $flowed = new Horde_Text_Flowed($text, $this->_params['charset']); + $flowed = new Horde_Text_Flowed($text, 'UTF-8'); $flowed->setOptLength($this->_params['width']); $text = $flowed->toFlowed(); } else { diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Space2html.php b/framework/Text_Filter/lib/Horde/Text/Filter/Space2html.php index 17f902deb..2cee35687 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Space2html.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Space2html.php @@ -28,7 +28,6 @@ class Horde_Text_Filter_Space2html extends Horde_Text_Filter_Base * @var array */ protected $_params = array( - 'charset' => 'ISO-8859-1', 'encode' => false, 'encode_all' => false ); @@ -43,7 +42,7 @@ class Horde_Text_Filter_Space2html extends Horde_Text_Filter_Base public function preProcess($text) { if ($this->_params['encode']) { - $text = @htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']); + $text = htmlspecialchars($text); } return $text; } diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Text2html.php b/framework/Text_Filter/lib/Horde/Text/Filter/Text2html.php index 56e692e70..37a24e6fd 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Text2html.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Text2html.php @@ -53,7 +53,6 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base * @var array */ protected $_params = array( - 'charset' => 'ISO-8859-1', 'class' => 'fixed', 'emails' => false, 'linkurls' => false, @@ -63,21 +62,6 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base ); /** - * Constructor. - * - * @param array $params Any parameters that the filter instance needs. - */ - public function __construct($params = array()) - { - parent::__construct($params); - - // Use ISO-8859-1 instead of US-ASCII - if (Horde_String::lower($this->_params['charset']) == 'us-ascii') { - $this->_params['charset'] = 'iso-8859-1'; - } - } - - /** * Executes any code necessary before applying the filter patterns. * * @param string $text The text before the filtering. @@ -92,7 +76,7 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base } if ($this->_params['parselevel'] == self::NOHTML_NOBREAK) { - return @htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']); + return htmlspecialchars($text); } if ($this->_params['parselevel'] < self::NOHTML) { @@ -124,12 +108,12 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base /* For level MICRO or NOHTML, start with htmlspecialchars(). */ $old_error = error_reporting(0); - $text2 = htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']); + $text2 = htmlspecialchars($text); /* Bad charset input in may result in an empty string. If so, try * using the default charset encoding instead. */ if (!$text2) { - $text2 = htmlspecialchars($text, ENT_COMPAT); + $text2 = htmlspecialchars($text); } $text = $text2; error_reporting($old_error); diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php b/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php index 08d274843..90411e7c6 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php @@ -6,8 +6,6 @@ * Filter parameters: * ------------------ *
- * 'charset' - (string) The charset of the text.
- *             DEFAULT: UTF-8
  * 'noprefetch' - (boolean) Disable DNS pre-fetching? See:
  *                https://developer.mozilla.org/En/Controlling_DNS_prefetching
  *                DEFAULT: false
@@ -45,7 +43,6 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base
      * @var array
      */
     protected $_params = array(
-        'charset' => 'UTF-8',
         'noprefetch' => false,
         'return_document' => false,
         'return_dom' => false,
@@ -100,7 +97,7 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base
     public function postProcess($text)
     {
         try {
-            $dom = new Horde_Domhtml($text, $this->_params['charset']);
+            $dom = new Horde_Domhtml($text, 'UTF-8');
         } catch (Exception $e) {
             return $text;
         }
@@ -138,7 +135,7 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base
             }
         }
 
-        return Horde_String::convertCharset($text, $dom->encoding, $this->_params['charset']);
+        return Horde_String::convertCharset($text, $dom->encoding, 'UTF-8');
     }
 
     /**
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php b/framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php
index 0a71c2f13..a592d2218 100644
--- a/framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php
+++ b/framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php
@@ -335,10 +335,7 @@ Links:
 [3] mailto:jane.doe@example.com
 EOT;
 
-        $filter = Horde_Text_Filter::filter($html, 'Html2text', array(
-            'charset' => 'UTF-8',
-            'width' => 70
-        ));
+        $filter = Horde_Text_Filter::filter($html, 'Html2text', array('width' => 70));
 
         $this->assertEquals($text, $filter);
     }
diff --git a/framework/Util/lib/Horde/String.php b/framework/Util/lib/Horde/String.php
index 4be30bcab..b67b5d800 100644
--- a/framework/Util/lib/Horde/String.php
+++ b/framework/Util/lib/Horde/String.php
@@ -471,7 +471,6 @@ class Horde_String
      * @param string $break          Character(s) to use when breaking lines.
      * @param boolean $cut           Whether to cut inside words if a line
      *                               can't be wrapped.
-     * @param string $charset        Character set to use when breaking lines.
      * @param boolean $line_folding  Whether to apply line folding rules per
      *                               RFC 822 or similar. The correct break
      *                               characters including leading whitespace
@@ -480,21 +479,13 @@ class Horde_String
      * @return string  String containing the wrapped text.
      */
     static public function wordwrap($string, $width = 75, $break = "\n",
-                                    $cut = false, $charset = null,
-                                    $line_folding = false)
+                                    $cut = false, $line_folding = false)
     {
-        /* Get the user's default character set if none passed in. */
-        if (is_null($charset)) {
-            $charset = self::$_charset;
-        }
-
-        $charset = self::_mbstringCharset($charset);
-        $string = self::convertCharset($string, $charset, 'utf-8');
         $wrapped = '';
 
-        while (self::length($string, 'utf-8') > $width) {
-            $line = self::substr($string, 0, $width, 'utf-8');
-            $string = self::substr($string, self::length($line, 'utf-8'), null, 'utf-8');
+        while (self::length($string, 'UTF-8') > $width) {
+            $line = self::substr($string, 0, $width, 'UTF-8');
+            $string = self::substr($string, self::length($line, 'UTF-8'), null, 'UTF-8');
 
             // Make sure didn't cut a word, unless we want hard breaks anyway.
             if (!$cut && preg_match('/^(.+?)((\s|\r?\n).*)/us', $string, $match)) {
@@ -538,7 +529,7 @@ class Horde_String
             $wrapped .= $line;
         }
 
-        return self::convertCharset($wrapped . $string, 'utf-8', $charset);
+        return $wrapped . $string;
     }
 
     /**
@@ -547,7 +538,6 @@ class Horde_String
      * @param string $text        String containing the text to wrap.
      * @param integer $length     Wrap $text at this number of characters.
      * @param string $break_char  Character(s) to use when breaking lines.
-     * @param string $charset     Character set to use when breaking lines.
      * @param boolean $quote      Ignore lines that are wrapped with the '>'
      *                            character (RFC 2646)? If true, we don't
      *                            remove any padding whitespace at the end of
@@ -556,7 +546,7 @@ class Horde_String
      * @return string  String containing the wrapped text.
      */
     static public function wrap($text, $length = 80, $break_char = "\n",
-                                $charset = null, $quote = false)
+                                $quote = false)
     {
         $paragraphs = array();
 
@@ -570,7 +560,7 @@ class Horde_String
                 if ($input != '-- ') {
                     $input = rtrim($input);
                 }
-                $line = self::wordwrap($input, $length, $break_char, false, $charset);
+                $line = self::wordwrap($input, $length, $break_char);
             }
 
             $paragraphs[] = $line;
diff --git a/framework/Util/test/Horde/Util/StringTest.php b/framework/Util/test/Horde/Util/StringTest.php
index 07ff77b05..65d74177a 100644
--- a/framework/Util/test/Horde/Util/StringTest.php
+++ b/framework/Util/test/Horde/Util/StringTest.php
@@ -272,7 +272,7 @@ Lörem ipsüm dölör sit ämet, cönsectetüer ädipiscing elit. Aliqüäm
 söllicitüdin fäücibüs mäüris ämet.
 EOT
 ,
-            Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string));
         $this->assertEquals(
 <<assertEquals(
 <<assertEquals(
 <<assertEquals(
 <<assertEquals(
 <<valueBeforeTypeCast($this->object(), $options);
         }
 
-        return $this->contentTag('textarea', htmlentities($value, ENT_QUOTES, 'utf-8'), $options);
+        return $this->contentTag('textarea', htmlentities($value), $options);
     }
 
     public function toCheckBoxTag($options = array(), $checkedValue = '1', $uncheckedValue = '0')
diff --git a/gollem/templates/common-header.inc b/gollem/templates/common-header.inc
index eb116777c..d63dfc17a 100644
--- a/gollem/templates/common-header.inc
+++ b/gollem/templates/common-header.inc
@@ -1,6 +1,6 @@
 
diff --git a/gollem/templates/javascript_defs.php b/gollem/templates/javascript_defs.php
index f93207b13..eb522e37c 100644
--- a/gollem/templates/javascript_defs.php
+++ b/gollem/templates/javascript_defs.php
@@ -1,7 +1,5 @@
  Horde::getServiceLink('ajax', 'gollem')->url,
@@ -29,6 +27,6 @@ $gettext = array_map('addslashes', array(
 
 ?>
 
diff --git a/hermes/start.php b/hermes/start.php
index 95d9d3e3b..fb3425578 100644
--- a/hermes/start.php
+++ b/hermes/start.php
@@ -29,8 +29,8 @@ if ($form->validate($vars)) {
     }
     $now = time();
     $timers[$now] = array('name' => Horde_String::convertCharset($vars->get('description'),
-                                                       'UTF-8',
-                                                       $prefs->getCharset()),
+                                                                 'UTF-8',
+                                                                 $prefs->getCharset()),
                           'time' => $now);
     $prefs->setValue('running_timers', serialize($timers), false);
 
diff --git a/hermes/templates/common-header.inc b/hermes/templates/common-header.inc
index 73b60036c..7c48361d6 100644
--- a/hermes/templates/common-header.inc
+++ b/hermes/templates/common-header.inc
@@ -1,6 +1,6 @@
 
diff --git a/horde/admin/config/config.php b/horde/admin/config/config.php
index c3a055bd8..5940d0c91 100644
--- a/horde/admin/config/config.php
+++ b/horde/admin/config/config.php
@@ -55,7 +55,7 @@ if (Horde_Util::getFormData('submitbutton') == _("Revert Configuration")) {
     }
     if ($fp = @fopen($path . '/conf.php', 'w')) {
         /* Can write, so output to file. */
-        fwrite($fp, Horde_String::convertCharset($php, 'UTF-8', 'iso-8859-1'));
+        fwrite($fp, $php);
         fclose($fp);
         $notification->push(sprintf(_("Successfully wrote %s"), Horde_Util::realPath($path . '/conf.php')), 'horde.success');
         $registry->clearCache();
diff --git a/horde/admin/config/scripts.php b/horde/admin/config/scripts.php
index b4c4ed5ab..57c97b1a9 100644
--- a/horde/admin/config/scripts.php
+++ b/horde/admin/config/scripts.php
@@ -57,10 +57,7 @@ if ($setup == 'conf' && $type == 'php') {
 
         $data .= 'if ($fp = @fopen(\'' . $path . '/conf.php\', \'w\')) {' . "\n";
         $data .= '    fwrite($fp, \'';
-        $data .= Horde_String::convertCharset(str_replace(array('\\', '\''),
-                                                    array('\\\\', '\\\''),
-                                                    $php),
-                                        'UTF-8', 'iso-8859-1');
+        $data .= str_replace(array('\\', '\''), array('\\\\', '\\\''), $php);
         $data .= '\');' . "\n";
         $data .= '    fclose($fp);' . "\n";
         $data .= '    echo \'' . sprintf('Saved %s configuration.', $app) . '\' . "\n";' . "\n";
diff --git a/horde/config/hooks.php.dist b/horde/config/hooks.php.dist
index cca20f658..c06340a8d 100644
--- a/horde/config/hooks.php.dist
+++ b/horde/config/hooks.php.dist
@@ -287,8 +287,6 @@ class Horde_Hooks
 //        $ldapServer = 'ldap.example.com';
 //        $ldapPort = '389';
 //        $searchBase = 'ou=people,o=example.com';
-//        $ldapcharset = 'utf-8';
-//        $outputcharset = 'UTF-8';
 //
 //        $ds = @ldap_connect($ldapServer, $ldapPort);
 //
@@ -311,7 +309,6 @@ class Horde_Hooks
 //
 //        ldap_close($ds);
 //
-//        $name = Horde_String::convertCharset($name, $ldapcharset, $outputcharset);
 //        return empty($name) ? $user : $name;
 //    }
 
diff --git a/horde/config/nls.php b/horde/config/nls.php
index 8c00e32b6..10d135ede 100644
--- a/horde/config/nls.php
+++ b/horde/config/nls.php
@@ -118,7 +118,6 @@ $horde_nls_config = array(
         'cs_CZ' => 'ISO-8859-2',
         'el_GR' => 'ISO-8859-7',
         'et_EE' => 'ISO-8859-13',
-        'eu_ES' => 'UTF-8',
         'fa_IR' => 'UTF-8',
         'he_IL' => 'UTF-8',
         'hu_HU' => 'ISO-8859-2',
diff --git a/horde/docs/CHANGES b/horde/docs/CHANGES
index 43690949d..00f34e76e 100644
--- a/horde/docs/CHANGES
+++ b/horde/docs/CHANGES
@@ -2,6 +2,7 @@
 v4.0-cvs
 --------
 
+[jan] Require mandatory UTF-8 support for both servers and clients.
 [jan] Renamed Setup to Configuration and Options to Preferences.
 [mms] Moved sidebar code out of block/portal code (Request #9160).
 [cjh] Remove fckeditor, standardizing on ckeditor.
diff --git a/horde/docs/INSTALL b/horde/docs/INSTALL
index b50cdd70b..fec253fa8 100644
--- a/horde/docs/INSTALL
+++ b/horde/docs/INSTALL
@@ -232,9 +232,8 @@ The following prerequisites are **REQUIRED** for Horde to function properly.
 
    c. UTF-8 support ``--enable-mbstring``
 
-      If these extensions are enabled, Horde can support multibyte character
-      sets like UTF-8 (meaning that content with any charset can be viewed
-      with any translation).
+      If these extensions are enabled, Horde can better support
+      multibyte character sets like UTF-8.
 
       For iconv support you should use the GNU libiconv library, which is more
       stable and supports more charsets, compared to other iconv
diff --git a/horde/lib/Block/twitter_timeline.php b/horde/lib/Block/twitter_timeline.php
index 0c4ff095c..b3f95222c 100644
--- a/horde/lib/Block/twitter_timeline.php
+++ b/horde/lib/Block/twitter_timeline.php
@@ -158,7 +158,7 @@ EOT;
         Horde::addInlineScript($script, 'dom');
 
         /* Get the user's most recent tweet */
-        $latestStatus = htmlspecialchars($this->_profile->status->text, ENT_COMPAT, 'UTF-8');
+        $latestStatus = htmlspecialchars($this->_profile->status->text);
 
         /* Build the UI */
         $html = '
' diff --git a/horde/lib/Test.php b/horde/lib/Test.php index c928488aa..2888d12a0 100644 --- a/horde/lib/Test.php +++ b/horde/lib/Test.php @@ -353,7 +353,7 @@ class Horde_Test error_reporting(E_ALL); /* Set character encoding. */ - header('Content-type: text/html; charset=utf-8'); + header('Content-type: text/html; charset=UTF-8'); header('Vary: Accept-Language'); } diff --git a/horde/services/portal/index.php b/horde/services/portal/index.php index 7de0e801c..6531b964e 100644 --- a/horde/services/portal/index.php +++ b/horde/services/portal/index.php @@ -29,7 +29,7 @@ if (!count($layout_pref)) { // If we're serving a request to the JS update client, just return the blocks // updated HTML content. if (Horde_Util::getFormData('httpclient')) { - header('Content-Type: text/html; charset=' . 'UTF-8'); + header('Content-Type: text/html; charset=UTF-8'); $row = Horde_Util::getFormData('row'); $col = Horde_Util::getFormData('col'); if (!is_null($row) && !is_null($col) && !empty($layout_pref[$row][$col])) { diff --git a/horde/services/sidebar.php b/horde/services/sidebar.php index 30d22dd69..6d7680143 100644 --- a/horde/services/sidebar.php +++ b/horde/services/sidebar.php @@ -31,7 +31,6 @@ if (!Horde_Util::getFormData('ajaxui') && $ajax_url = Horde::getServiceLink('ajax', 'horde'); $ajax_url->pathInfo = 'sidebarUpdate'; - $charset = 'UTF-8'; $rtl = intval(isset($registry->nlsconfig['rtl'][$language])); $show_sidebar = !isset($_COOKIE['horde_sidebar_expanded']) || $_COOKIE['horde_sidebar_expanded']; $width = intval($prefs->getValue('sidebar_width')); diff --git a/horde/services/twitter.php b/horde/services/twitter.php index 854907e98..69f459be1 100644 --- a/horde/services/twitter.php +++ b/horde/services/twitter.php @@ -97,8 +97,8 @@ case 'getPage': /* These are all referencing the *original* tweet */ $view->profileLink = Horde::externalUrl('http://twitter.com/' . htmlspecialchars($tweetObj->user->screen_name), true); $view->profileImg = $tweetObj->user->profile_image_url; - $view->authorName = htmlspecialchars($tweetObj->user->screen_name, ENT_COMPAT, 'UTF-8'); - $view->authorFullname = htmlspecialchars($tweetObj->user->name, ENT_COMPAT, 'UTF-8'); + $view->authorName = htmlspecialchars($tweetObj->user->screen_name); + $view->authorFullname = htmlspecialchars($tweetObj->user->name); $view->createdAt = $tweetObj->created_at; $view->clientText = $filter->filter($tweet->source, 'xss'); $view->tweet = $tweet; diff --git a/horde/templates/admin/groups/edit.inc b/horde/templates/admin/groups/edit.inc index 2e555cdff..60c043464 100644 --- a/horde/templates/admin/groups/edit.inc +++ b/horde/templates/admin/groups/edit.inc @@ -60,7 +60,7 @@ -getShortName()), ENT_COMPAT, 'UTF-8') ?>" /> +getShortName())) ?>" />


diff --git a/horde/templates/common-header.inc b/horde/templates/common-header.inc index cf665bfcb..d222811e8 100644 --- a/horde/templates/common-header.inc +++ b/horde/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/hylax/templates/common-header.inc b/hylax/templates/common-header.inc index 93ea201c8..86ef99f68 100644 --- a/hylax/templates/common-header.inc +++ b/hylax/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/imp/lib/Mime/Viewer/Itip.php b/imp/lib/Mime/Viewer/Itip.php index d8adcbf1c..2d65d3968 100644 --- a/imp/lib/Mime/Viewer/Itip.php +++ b/imp/lib/Mime/Viewer/Itip.php @@ -356,7 +356,7 @@ class IMP_Mime_Viewer_Itip extends Horde_Mime_Viewer_Base $message = _("Attached is a reply to a calendar request you sent."); $body = new Horde_Mime_Part('text/plain', - Horde_String::wrap($message, 76, "\n"), + Horde_String::wrap($message, 76), $charset); $ics = new Horde_Mime_Part('text/calendar', $vCal->exportvCalendar()); diff --git a/imp/templates/common-header.inc b/imp/templates/common-header.inc index b4ffa1d37..e82344860 100644 --- a/imp/templates/common-header.inc +++ b/imp/templates/common-header.inc @@ -19,7 +19,7 @@ default: } if (isset($GLOBALS['language'])) { - header('Content-type: text/html; charset=' . 'UTF-8'); + header('Content-type: text/html; charset=UTF-8'); header('Vary: Accept-Language'); } ?> diff --git a/ingo/filters.php b/ingo/filters.php index 31fcfe629..c71ecd729 100644 --- a/ingo/filters.php +++ b/ingo/filters.php @@ -62,7 +62,7 @@ case 'rule_enable': try { $message = Horde::callHook('perms_denied', array('ingo:allow_rules')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(_("You are not allowed to create or edit custom rules.")); } $notification->push($message, 'horde.error', array('content.raw')); break 2; @@ -71,7 +71,7 @@ case 'rule_enable': try { $message = Horde::callHook('perms_denied', array('ingo:max_rules')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules'))); } $notification->push($message, 'horde.error', array('content.raw')); break 2; @@ -210,7 +210,7 @@ if (count($filter_list) == 0) { /* Create description. */ if (!$edit_allowed) { - $entry['descriplink'] = @htmlspecialchars($name, ENT_COMPAT, 'UTF-8'); + $entry['descriplink'] = htmlspecialchars($name); } elseif (!empty($filter['conditions'])) { $descrip = ''; $condition_size = count($filter['conditions']) - 1; @@ -239,9 +239,9 @@ if (count($filter_list) == 0) { $descrip .= "\n[stop]"; } - $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . ''; + $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . htmlspecialchars($name) . ''; } else { - $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . ''; + $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . htmlspecialchars($name) . ''; } /* Create edit link. */ diff --git a/ingo/lib/Ingo.php b/ingo/lib/Ingo.php index 47dfaa34b..f765ab83b 100644 --- a/ingo/lib/Ingo.php +++ b/ingo/lib/Ingo.php @@ -457,7 +457,7 @@ class Ingo if ($GLOBALS['registry']->hasMethod('mail/createFolder')) { Horde::addScriptFile('new_folder.js', 'ingo'); Horde::addInlineScript(array( - 'IngoNewFolder.folderprompt = ' . Horde_Serialize::serialize(_("Please enter the name of the new folder:"), Horde_Serialize::JSON, 'UTF-8') + 'IngoNewFolder.folderprompt = ' . Horde_Serialize::serialize(_("Please enter the name of the new folder:"), Horde_Serialize::JSON) )); } } diff --git a/ingo/lib/Script.php b/ingo/lib/Script.php index b5bd7390e..b02d6cc90 100644 --- a/ingo/lib/Script.php +++ b/ingo/lib/Script.php @@ -126,9 +126,6 @@ class Ingo_Script if (!isset($params['spam_char'])) { $params['spam_char'] = $GLOBALS['conf']['spam']['char']; } - if (!isset($params['charset'])) { - $params['charset'] = 'UTF-8'; - } if ($script == 'Sieve') { if (!isset($params['date_format'])) { $params['date_format'] = $GLOBALS['prefs']->getValue('date_format');; diff --git a/ingo/lib/Script/Sieve.php b/ingo/lib/Script/Sieve.php index 4b2bfe47f..8f7929377 100644 --- a/ingo/lib/Script/Sieve.php +++ b/ingo/lib/Script/Sieve.php @@ -131,7 +131,6 @@ class Ingo_Script_Sieve extends Ingo_Script . _("Generated by Ingo (http://www.horde.org/ingo/)") . ' (' . trim(strftime($this->_params['date_format'] . ', ' . $this->_params['time_format'])) . ")\n\n"; - $code = $this->encode($code); $requires = $this->requires(); if (count($requires) > 1) { @@ -155,18 +154,6 @@ class Ingo_Script_Sieve extends Ingo_Script } /** - * Encodes a string to UTF-8. - * - * @param string $string The string to encode. - * - * @return string The string, UTF-8 encoded. - */ - public function encode($string) - { - return Horde_String::convertCharset($string, $this->_params['charset'], 'UTF-8'); - } - - /** * Escape a string according to Sieve RFC 3028 [2.4.2]. * * @param string $string The string to escape. @@ -244,7 +231,7 @@ class Ingo_Script_Sieve extends Ingo_Script if (count($action)) { if($forward->getForwardKeep()) { - $this->_endBlocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Forward Keep Action"))); + $this->_endBlocks[] = new Ingo_Script_Sieve_Comment(_("Forward Keep Action")); $if = new Ingo_Script_Sieve_If(new Ingo_Script_Sieve_Test_True()); $if->setActions(array(new Ingo_Script_Sieve_Action_Keep(), new Ingo_Script_Sieve_Action_Stop())); @@ -254,7 +241,7 @@ class Ingo_Script_Sieve extends Ingo_Script } } - $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Forwards"))); + $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Forwards")); $test = new Ingo_Script_Sieve_Test_True(); $if = new Ingo_Script_Sieve_If($test); @@ -291,7 +278,7 @@ class Ingo_Script_Sieve extends Ingo_Script $action[] = new Ingo_Script_Sieve_Action_Stop(); - $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Blacklisted Addresses"))); + $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Blacklisted Addresses")); /* Split the test up to only do 5 addresses at a time. */ $temp = array(); @@ -351,7 +338,7 @@ class Ingo_Script_Sieve extends Ingo_Script return; } - $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Whitelisted Addresses"))); + $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Whitelisted Addresses")); $action = array(new Ingo_Script_Sieve_Action_Keep(), new Ingo_Script_Sieve_Action_Stop()); $test = new Ingo_Script_Sieve_Test_Address(array('headers' => "From\nSender\nResent-From", 'addresses' => implode("\n", $wl_addr))); @@ -376,7 +363,7 @@ class Ingo_Script_Sieve extends Ingo_Script } $vals = array( - 'subject' => $this->encode($vacation->getVacationSubject()), + 'subject' => $vacation->getVacationSubject(), 'days' => $vacation->getVacationDays(), 'addresses' => $vacation_addr, 'start' => $vacation->getVacationStart(), @@ -387,7 +374,7 @@ class Ingo_Script_Sieve extends Ingo_Script 'end_year' => $vacation->getVacationEndYear(), 'end_month' => $vacation->getVacationEndMonth(), 'end_day' => $vacation->getVacationEndDay(), - 'reason' => $this->encode($vacation->getVacationReason()), + 'reason' => $vacation->getVacationReason(), ); $action = $tests = array(); @@ -426,7 +413,7 @@ class Ingo_Script_Sieve extends Ingo_Script $tests[] = new Ingo_Script_Sieve_Test_Not($tmp); } - $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Vacation"))); + $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Vacation")); if ($tests) { $test = new Ingo_Script_Sieve_Test_Allof($tests); @@ -452,7 +439,7 @@ class Ingo_Script_Sieve extends Ingo_Script return; } - $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Spam Filter"))); + $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Spam Filter")); $actions = array(); $actions[] = new Ingo_Script_Sieve_Action_Fileinto(array_merge($this->_params, array('folder' => $spam->getSpamFolder()))); @@ -596,7 +583,7 @@ class Ingo_Script_Sieve extends Ingo_Script continue 2; } - $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode($filter['name'])); + $this->_blocks[] = new Ingo_Script_Sieve_Comment($filter['name']); if ($filter['stop']) { $action[] = new Ingo_Script_Sieve_Action_Stop(); diff --git a/ingo/lib/Storage/Sql.php b/ingo/lib/Storage/Sql.php index 434e56b61..f3c464f42 100644 --- a/ingo/lib/Storage/Sql.php +++ b/ingo/lib/Storage/Sql.php @@ -272,11 +272,11 @@ class Ingo_Storage_Sql extends Ingo_Storage $values = array( implode("\n", $ob->getVacationAddresses()), Horde_String::convertCharset($ob->getVacationSubject(), - 'UTF-8', - $this->_params['charset']), + 'UTF-8', + $this->_params['charset']), Horde_String::convertCharset($ob->getVacationReason(), - 'UTF-8', - $this->_params['charset']), + 'UTF-8', + $this->_params['charset']), (int)$ob->getVacationDays(), (int)$ob->getVacationStart(), (int)$ob->getVacationEnd(), diff --git a/ingo/lib/tests/MaildropTest.php b/ingo/lib/tests/MaildropTest.php index 735cde1cf..ddab9a0e6 100644 --- a/ingo/lib/tests/MaildropTest.php +++ b/ingo/lib/tests/MaildropTest.php @@ -28,7 +28,6 @@ class Ingo_MaildropTest extends Ingo_TestBase { $GLOBALS['ingo_script'] = Ingo_Script::factory( 'maildrop', array('path_style' => 'mbox', - 'charset' => 'UTF-8', 'spam_compare' => 'string', 'spam_header' => 'X-Spam-Level', 'spam_char' => '*')); diff --git a/ingo/lib/tests/ProcmailTest.php b/ingo/lib/tests/ProcmailTest.php index c4639a9cf..e27e2d2c6 100644 --- a/ingo/lib/tests/ProcmailTest.php +++ b/ingo/lib/tests/ProcmailTest.php @@ -31,7 +31,6 @@ class Ingo_ProcmailTest extends Ingo_TestBase { $GLOBALS['ingo_script'] = Ingo_Script::factory( 'procmail', array('path_style' => 'mbox', - 'charset' => 'UTF-8', 'spam_compare' => 'string', 'spam_header' => 'X-Spam-Level', 'spam_char' => '*')); diff --git a/ingo/lib/tests/ScriptTest.php b/ingo/lib/tests/ScriptTest.php index ab05794a0..6006d61cf 100644 --- a/ingo/lib/tests/ScriptTest.php +++ b/ingo/lib/tests/ScriptTest.php @@ -154,7 +154,6 @@ class ScriptTester_imap extends ScriptTester { $GLOBALS['notification'] = new Ingo_Test_Notification; $params = array('api' => $this->api, - 'charset' => 'UTF-8', 'spam_compare' => 'string', 'spam_header' => 'X-Spam-Level', 'spam_char' => '*'); @@ -312,7 +311,6 @@ class ScriptTester_sieve extends ScriptTester { { $params = array('date_format' => '%x', 'time_format' => '%R', - 'charset' => 'UTF-8', 'spam_compare' => 'string', 'spam_header' => 'X-Spam-Level', 'spam_char' => '*'); diff --git a/ingo/lib/tests/SieveTest.php b/ingo/lib/tests/SieveTest.php index 856c39635..fc89aa47f 100644 --- a/ingo/lib/tests/SieveTest.php +++ b/ingo/lib/tests/SieveTest.php @@ -30,8 +30,7 @@ class Ingo_SieveTest extends Ingo_TestBase { 'maxwhitelist' => 3)); $GLOBALS['ingo_script'] = Ingo_Script::factory( 'sieve', - array('charset' => 'UTF-8', - 'spam_compare' => 'string', + array('spam_compare' => 'string', 'spam_header' => 'X-Spam-Level', 'spam_char' => '*', 'date_format' => '%x', diff --git a/ingo/rule.php b/ingo/rule.php index b7be022e1..5d7f95f15 100644 --- a/ingo/rule.php +++ b/ingo/rule.php @@ -20,7 +20,7 @@ if (!$perms->hasAppPermission('allow_rules')) { try { $message = Horde::callHook('perms_denied', array('ingo:allow_rules')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(_("You are not allowed to create or edit custom rules.")); } $notification->push($message, 'horde.error', array('content.raw')); Horde::url('filters.php', true)->redirect(); @@ -171,7 +171,7 @@ default: try { $message = Horde::callHook('perms_denied', array('ingo:max_rules')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules'))); } $notification->push($message, 'horde.error', array('content.raw')); header('Location: ' . Horde::url('filters.php', true)); diff --git a/ingo/templates/common-header.inc b/ingo/templates/common-header.inc index 0580182b7..601867f2b 100644 --- a/ingo/templates/common-header.inc +++ b/ingo/templates/common-header.inc @@ -1,6 +1,6 @@ get('name'); diff --git a/ingo/templates/rule/header.inc b/ingo/templates/rule/header.inc index 129de55da..aa45e472e 100644 --- a/ingo/templates/rule/header.inc +++ b/ingo/templates/rule/header.inc @@ -18,7 +18,7 @@ - + @@ -74,14 +74,14 @@ if ($this->event->initialized && $this->event->alarm > 0): - + - + diff --git a/luxor/templates/common-header.inc b/luxor/templates/common-header.inc index 83626c71c..1e62a8282 100644 --- a/luxor/templates/common-header.inc +++ b/luxor/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/mnemo/data.php b/mnemo/data.php index 88ed5e89b..d63fa4871 100644 --- a/mnemo/data.php +++ b/mnemo/data.php @@ -34,7 +34,7 @@ $templates = array( ); if ($GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') !== true && $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') <= Mnemo::countMemos()) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message); } @@ -121,7 +121,7 @@ if (is_array($next_step)) { $num_memos = Mnemo::countMemos(); foreach ($next_step as $row) { if ($max_memos !== true && $num_memos >= $max_memos) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message); } diff --git a/mnemo/memo.php b/mnemo/memo.php index 310b43a25..f1185f41b 100644 --- a/mnemo/memo.php +++ b/mnemo/memo.php @@ -72,7 +72,7 @@ case 'add_memo': /* Check permissions. */ if ($injector->getInstance('Horde_Perms')->hasAppPermission('max_notes') !== true && $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes') <= Mnemo::countMemos()) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message); } diff --git a/mnemo/templates/common-header.inc b/mnemo/templates/common-header.inc index a329b56bf..80159ceac 100644 --- a/mnemo/templates/common-header.inc +++ b/mnemo/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/nag/data.php b/nag/data.php index afb9e4b37..e585a3483 100644 --- a/nag/data.php +++ b/nag/data.php @@ -41,7 +41,7 @@ if ($perms->hasAppPermission('max_tasks') !== true && try { $message = Horde::callHook('perms_denied', array('nag:max_tasks')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks'))); } $notification->push($message, 'horde.warning', array('content.raw')); $templates[Horde_Data::IMPORT_FILE] = array(NAG_TEMPLATES . '/data/export.inc'); @@ -169,7 +169,7 @@ if (is_array($next_step)) { try { $message = Horde::callHook('perms_denied', array('nag:max_tasks')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks'))); } $notification->push($message, 'horde.error', array('content.raw')); break; diff --git a/nag/lib/Api.php b/nag/lib/Api.php index 02e1872f8..5198d9448 100644 --- a/nag/lib/Api.php +++ b/nag/lib/Api.php @@ -1060,7 +1060,7 @@ class Nag_Api extends Horde_Registry_Api $share = $GLOBALS['nag_shares']->getShare($tasklist); $iCal = new Horde_iCalendar($version); - $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'utf-8')); + $iCal->setAttribute('X-WR-CALNAME', $share->get('name')); $tasks->reset(); while ($task = $tasks->each()) { diff --git a/nag/lib/Forms/task.php b/nag/lib/Forms/task.php index b76b9f4a8..f190e5493 100644 --- a/nag/lib/Forms/task.php +++ b/nag/lib/Forms/task.php @@ -46,7 +46,7 @@ class Nag_TaskForm extends Horde_Form { if ($vars->get('task_id') == $task->id) { continue; } - $task_enums[htmlspecialchars($task->id)] = str_repeat(' ', $task->indent * 4) . htmlentities($task->name, ENT_COMPAT, 'UTF-8'); + $task_enums[htmlspecialchars($task->id)] = str_repeat(' ', $task->indent * 4) . htmlentities($task->name); } $users = array(); $share = $GLOBALS['nag_shares']->getShare($tasklist); diff --git a/nag/lib/Nag.php b/nag/lib/Nag.php index c6117dc89..d9bd32030 100644 --- a/nag/lib/Nag.php +++ b/nag/lib/Nag.php @@ -672,12 +672,11 @@ class Nag return Horde::link($GLOBALS['registry']->call( 'mail/compose', array(array('to' => $email)))) - . @htmlspecialchars($fullname . ' <' . $email . '>', - ENT_COMPAT, 'UTF-8') + . htmlspecialchars($fullname . ' <' . $email . '>') . ''; } - return @htmlspecialchars($fullname, ENT_COMPAT, 'UTF-8'); + return htmlspecialchars($fullname); } /** diff --git a/nag/lib/Task.php b/nag/lib/Task.php index 01c84b16d..f6bb6120f 100644 --- a/nag/lib/Task.php +++ b/nag/lib/Task.php @@ -800,11 +800,11 @@ class Nag_Task { } if (!empty($this->name)) { - $vTodo->setAttribute('SUMMARY', $v1 ? $this->name : Horde_String::convertCharset($this->name, 'UTF-8', 'utf-8')); + $vTodo->setAttribute('SUMMARY', $this->name); } if (!empty($this->desc)) { - $vTodo->setAttribute('DESCRIPTION', $v1 ? $this->desc : Horde_String::convertCharset($this->desc, 'UTF-8', 'utf-8')); + $vTodo->setAttribute('DESCRIPTION', $this->desc); } if (isset($this->priority)) { @@ -850,7 +850,7 @@ class Nag_Task { } if (!empty($this->category)) { - $vTodo->setAttribute('CATEGORIES', $v1 ? $this->category : Horde_String::convertCharset($this->category, 'UTF-8', 'utf-8')); + $vTodo->setAttribute('CATEGORIES', $this->category); } /* Get the task's history. */ @@ -891,8 +891,8 @@ class Nag_Task { $message = new Horde_ActiveSync_Message_Task(); /* Notes and Title */ - $message->setBody(Horde_String::convertCharset($this->desc, 'UTF-8', 'utf-8')); - $message->setSubject(Horde_String::convertCharset($this->name, 'UTF-8', 'utf-8')); + $message->setBody($this->desc); + $message->setSubject($this->name); /* Completion */ if ($this->completed) { @@ -1043,8 +1043,8 @@ class Nag_Task { function fromASTask(Horde_ActiveSync_Message_Task $message) { /* Notes and Title */ - $this->desc = Horde_String::convertCharset($message->getBody(), 'utf-8', 'UTF-8'); - $this->name = Horde_String::convertCharset($message->getSubject(), 'utf-8', 'UTF-8'); + $this->desc = $message->getBody(); + $this->name = $message->getSubject(); /* Completion */ if ($this->completed = $message->getComplete()) { diff --git a/nag/task.php b/nag/task.php index 92e53340a..f744430b0 100644 --- a/nag/task.php +++ b/nag/task.php @@ -71,7 +71,7 @@ case 'add_task': try { $message = Horde::callHook('perms_denied', array('nag:max_tasks')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks'))); } $notification->push($message, 'horde.error', array('content.raw')); Horde::url('list.php', true)->redirect(); diff --git a/nag/templates/common-header.inc b/nag/templates/common-header.inc index 5d7a22df4..7726b2068 100644 --- a/nag/templates/common-header.inc +++ b/nag/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/nag/templates/view/task.inc b/nag/templates/view/task.inc index 3eece0307..36b610d74 100644 --- a/nag/templates/view/task.inc +++ b/nag/templates/view/task.inc @@ -59,14 +59,14 @@ - + - + diff --git a/news/pdf.php b/news/pdf.php index d5fd9c9e4..91e2dc28c 100644 --- a/news/pdf.php +++ b/news/pdf.php @@ -54,7 +54,7 @@ $pdf->newLine(4); $pdf->write(12, _("On") . ': ' . News::dateFormat($row['publish']) . "\n"); $pdf->write(12, _("Link") . ': ' . News::getUrlFor('news', $id, true) . "\n\n", News::getUrlFor('news', $id, true)); -$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), 'UTF-8', 'UTF-8')); +$pdf->multiCell(0, 12, strip_tags($row['content'])); $browser->downloadHeaders($id . '.pdf', 'application/pdf'); echo $pdf->getOutput(); diff --git a/news/rss/comments.php b/news/rss/comments.php index 3844b8f1f..57a65d511 100644 --- a/news/rss/comments.php +++ b/news/rss/comments.php @@ -19,7 +19,7 @@ if (!$rss) { $list = News::getLastComments(50); $title = _("Last comments"); - $rss = ' + $rss = ' ' . htmlspecialchars($title) . ' @@ -47,5 +47,5 @@ if (!$rss) { $cache->set($cache_key, $rss); } -header('Content-type: text/xml; charset=' . 'UTF-8'); +header('Content-type: text/xml; charset=UTF-8'); echo $rss; diff --git a/news/rss/index.php b/news/rss/index.php index be6ba6c3d..8d091b529 100644 --- a/news/rss/index.php +++ b/news/rss/index.php @@ -22,7 +22,7 @@ if (!$rss) { $title = $registry->get('name', 'horde'); $read_url = Horde::url('read.php', true, -1); - $rss = ' + $rss = ' ' . htmlspecialchars($title) . ' diff --git a/news/rss/news.php b/news/rss/news.php index 5df939eab..190dbbc75 100755 --- a/news/rss/news.php +++ b/news/rss/news.php @@ -53,7 +53,7 @@ if (empty($rss)) { } // Wee need the last published news time - $rssheader = ' + $rssheader = ' diff --git a/operator/templates/common-header.inc b/operator/templates/common-header.inc index 3d3d06c39..d1bc89c92 100644 --- a/operator/templates/common-header.inc +++ b/operator/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/pastie/templates/common-header.inc b/pastie/templates/common-header.inc index 90f306bee..06da9aa97 100644 --- a/pastie/templates/common-header.inc +++ b/pastie/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/shout/templates/common-header.inc b/shout/templates/common-header.inc index a278cfa71..edec2934c 100644 --- a/shout/templates/common-header.inc +++ b/shout/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/shout/templates/dialplan/edit.inc b/shout/templates/dialplan/edit.inc index 216fef795..fbee5d1f6 100644 --- a/shout/templates/dialplan/edit.inc +++ b/shout/templates/dialplan/edit.inc @@ -94,10 +94,10 @@ var ajax_url = ''; var curmenu = null; var menuInfo = $H(); -var menuActions = $H(); -var destinations = $H(); -var conferences = $H(); -var recordings = $H(); +var menuActions = $H(); +var destinations = $H(); +var conferences = $H(); +var recordings = $H(); function empty(p) { diff --git a/skeleton/templates/common-header.inc b/skeleton/templates/common-header.inc index 90f306bee..06da9aa97 100644 --- a/skeleton/templates/common-header.inc +++ b/skeleton/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/skoli/templates/common-header.inc b/skoli/templates/common-header.inc index df35f6c2b..ff189124d 100644 --- a/skoli/templates/common-header.inc +++ b/skoli/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/trean/add.php b/trean/add.php index 95a1b9db5..1ba1f0bfb 100644 --- a/trean/add.php +++ b/trean/add.php @@ -20,7 +20,7 @@ case 'add_bookmark': /* Check permissions. */ if (Trean::hasPermission('max_bookmarks') !== true && Trean::hasPermission('max_bookmarks') <= $trean_shares->countBookmarks()) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message); } @@ -83,7 +83,7 @@ case 'add_folder': /* Check permissions. */ if (Trean::hasPermission('max_folders') !== true && Trean::hasPermission('max_folders') <= Trean::countFolders()) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message); } diff --git a/trean/data.php b/trean/data.php index 88a14ea6c..58f6837d6 100644 --- a/trean/data.php +++ b/trean/data.php @@ -53,7 +53,7 @@ Horde_Registry::appInit('trean'); $folders_exceeded = Trean::hasPermission('max_folders') !== true && Trean::hasPermission('max_folders') <= Trean::countFolders(); if ($folders_exceeded) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message); } @@ -62,7 +62,7 @@ if ($folders_exceeded) { $bookmarks_exceeded = Trean::hasPermission('max_bookmarks') !== true && Trean::hasPermission('max_bookmarks') <= $trean_shares->countBookmarks(); if ($bookmarks_exceeded) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message); } @@ -104,7 +104,7 @@ case 'import': continue; } if ($max_folders !== true && $num_folders >= $max_folders) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message); } @@ -129,7 +129,7 @@ case 'import': $line, $temp)) { /* A bookmark. */ if ($max_bookmarks !== true && $num_bookmarks >= $max_bookmarks) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks'))); if (!empty($conf['hooks']['permsdenied'])) { $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message); } diff --git a/trean/rss.php b/trean/rss.php index 929fd2914..c10902f36 100644 --- a/trean/rss.php +++ b/trean/rss.php @@ -59,12 +59,12 @@ $cache = $GLOBALS['injector']->getInstance('Horde_Cache'); $cache_key = 'trean_rss_' . Horde_Auth::getAuth() . '_' . ($folderId === null ? 'all' : $folderId); $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']); if (!$rss) { - $rss = ' + $rss = ' ' . htmlspecialchars($folderId == null ? $registry->get('name') : $folder->get('name')) . ' ' . $registry->preferredLang() . ' - ' . 'UTF-8' . ' + UTF-8 ' . date('Y-m-d H:i:s') . ' http://' . $_SERVER['SERVER_NAME'] . $registry->get('webroot') . '/themes/graphics/favicon.ico diff --git a/trean/templates/common-header.inc b/trean/templates/common-header.inc index 2d302e134..27e515a78 100644 --- a/trean/templates/common-header.inc +++ b/trean/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/turba/add.php b/turba/add.php index 8f2b37587..ada57a7cd 100644 --- a/turba/add.php +++ b/turba/add.php @@ -48,7 +48,7 @@ if ($source) { try { $message = Horde::callHook('perms_denied', array('turba:max_contacts')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title'])); } $notification->push($message, 'horde.error', array('content.raw')); $url = $url diff --git a/turba/data.php b/turba/data.php index 754ddf32e..b146e7d83 100644 --- a/turba/data.php +++ b/turba/data.php @@ -349,7 +349,7 @@ case Horde_Data::IMPORT_FILE: try { $message = Horde::callHook('perms_denied', array('turba:max_contacts')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $driver->title), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $driver->title)); } $notification->push($message, 'horde.error', array('content.raw')); $error = true; diff --git a/turba/lib/Driver.php b/turba/lib/Driver.php index e49999399..7e23be277 100644 --- a/turba/lib/Driver.php +++ b/turba/lib/Driver.php @@ -972,10 +972,6 @@ class Turba_Driver implements Countable continue; } - if ($version != '2.1') { - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - } - switch ($key) { case 'name': if ($fields && !isset($fields['FN'])) { @@ -1641,10 +1637,6 @@ class Turba_Driver implements Countable Horde_Icalendar_Vcard::N_SUFFIX => isset($hash['nameSuffix']) ? $hash['nameSuffix'] : '', ); $val = implode(';', $a); - if ($version != '2.1') { - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8'); - } if (!$fields || isset($fields['N'])) { $vcard->setAttribute('N', $val, Horde_Mime::is8bit($val) ? $charset : array(), false, $a); } @@ -1658,9 +1650,6 @@ class Turba_Driver implements Countable } else { $val = ''; } - if ($version != '2.1') { - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - } $vcard->setAttribute('FN', $val, Horde_Mime::is8bit($val) ? $charset : array()); } @@ -1675,10 +1664,6 @@ class Turba_Driver implements Countable } if (count($org) && (!$fields || isset($fields['ORG']))) { $val = implode(';', $org); - if ($version != '2.1') { - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - $org = Horde_String::convertCharset($org, 'UTF-8', 'utf-8'); - } $vcard->setAttribute('ORG', $val, Horde_Mime::is8bit($val) ? $charset : array(), false, $org); } @@ -1733,8 +1718,6 @@ class Turba_Driver implements Countable } } else { $params = array('TYPE' => ''); - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8'); } $vcard->setAttribute('ADR', $val, $params, true, $a); } @@ -1788,8 +1771,6 @@ class Turba_Driver implements Countable } } else { $params = array('TYPE' => 'HOME'); - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8'); } $vcard->setAttribute('ADR', $val, $params, true, $a); } @@ -1843,8 +1824,6 @@ class Turba_Driver implements Countable } } else { $params = array('TYPE' => 'WORK'); - $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8'); - $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8'); } $vcard->setAttribute('ADR', $val, $params, true, $a); } @@ -2287,32 +2266,31 @@ class Turba_Driver implements Countable public function toASContact(Turba_Object $object) { $message = new Horde_ActiveSync_Message_Contact(array('logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger'))); - $charset = 'UTF-8'; $hash = $object->getAttributes(); foreach ($hash as $field => $value) { switch ($field) { case 'name': - $message->fileas = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->fileas = $value; break; case 'lastname': - $message->lastname = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->lastname = $value; break; case 'firstname': - $message->firstname = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->firstname = $value; break; case 'middlenames': - $message->middlename = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->middlename = $value; break; case 'namePrefix': - $message->title = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->title = $value; break; case 'nameSuffix': - $message->suffix = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->suffix = $value; break; case 'photo': @@ -2322,43 +2300,43 @@ class Turba_Driver implements Countable case 'homeStreet': /* Address (TODO: check for a single home/workAddress field * instead) */ - $message->homestreet = Horde_String::convertCharset($hash['homeStreet'], $charset, 'utf-8'); + $message->homestreet = $hash['homeStreet']; break; case 'homeCity': - $message->homecity = Horde_String::convertCharset($hash['homeCity'], $charset, 'utf-8'); + $message->homecity = $hash['homeCity']; break; case 'homeProvince': - $message->homestate = Horde_String::convertCharset($hash['homeProvince'], $charset, 'utf-8'); + $message->homestate = $hash['homeProvince']; break; case 'homePostalCode': - $message->homepostalcode = Horde_String::convertCharset($hash['homePostalCode'], $charset, 'utf-8'); + $message->homepostalcode = $hash['homePostalCode']; break; case 'homeCountry': - $message->homecountry = !empty($hash['homeCountry']) ? Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['homeCountry']), $charset, 'utf-8') : null; + $message->homecountry = !empty($hash['homeCountry']) ? Horde_Nls::getCountryISO($hash['homeCountry']) : null; break; case 'workStreet': - $message->businessstreet = Horde_String::convertCharset($hash['workStreet'], $charset, 'utf-8'); + $message->businessstreet = $hash['workStreet']; break; case 'workCity': - $message->businesscity = Horde_String::convertCharset($hash['workCity'], $charset, 'utf-8'); + $message->businesscity = $hash['workCity']; break; case 'workProvince': - $message->businessstate = Horde_String::convertCharset($hash['workProvince'], $charset, 'utf-8'); + $message->businessstate = $hash['workProvince']; break; case 'workPostalCode': - $message->businesspostalcode = Horde_String::convertCharset($hash['workPostalCode'], $charset, 'utf-8'); + $message->businesspostalcode = $hash['workPostalCode']; break; case 'workCountry': - $message->businesscountry = !empty($hash['workCountry']) ? Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['workCountry']), $charset, 'utf-8') : null; + $message->businesscountry = !empty($hash['workCountry']) ? Horde_Nls::getCountryISO($hash['workCountry']) : null; case 'homePhone': /* Phone */ @@ -2385,28 +2363,28 @@ class Turba_Driver implements Countable break; case 'title': - $message->jobtitle = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->jobtitle = $value; break; case 'company': - $message->companyname = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->companyname = $value; break; case 'departnemt': - $message->department = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->department = $value; break; case 'category': // Categories FROM horde are a simple string value, going BACK to horde are an array with 'value' and 'new' keys - $message->categories = explode(';', Horde_String::convertCharset($value, $charset, 'utf-8')); + $message->categories = explode(';', $value); break; case 'spouse': - $message->spouse = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->spouse = $value); break; case 'notes': /* Assume no truncation - AS server will truncate as needed */ - $message->body = Horde_String::convertCharset($value, $charset, 'utf-8'); + $message->body = $value; $message->bodysize = strlen($message->body); $message->bodytruncated = false; break; @@ -2428,7 +2406,7 @@ class Turba_Driver implements Countable } if (empty($this->fileas)) { - $message->fileas = Horde_String::convertCharset(Turba::formatName($object), $charset, 'utf-8'); + $message->fileas = Turba::formatName($object); } return $message; @@ -2446,7 +2424,6 @@ class Turba_Driver implements Countable public function fromASContact($message) { $hash = array(); - $charset = 'UTF-8'; $formattedname = false; $textMap = array( @@ -2474,7 +2451,7 @@ class Turba_Driver implements Countable ); foreach ($textMap as $asField => $turbaField) { if (!$message->isGhosted($asField)) { - $hash[$turbaField] = Horde_String::convertCharset($message->{$asField}, 'utf-8', $charset); + $hash[$turbaField] = $message->{$asField}; } } @@ -2505,7 +2482,7 @@ class Turba_Driver implements Countable /* Categories */ if (count($message->categories)) { - $hash['category'] = Horde_String::convertCharset(implode('|', $message->categories), 'utf-8', $charset); + $hash['category'] = implode('|', $message->categories); } elseif (!$message->isGhosted('categories')) { $hash['category'] = ''; } @@ -2529,7 +2506,7 @@ class Turba_Driver implements Countable if (!empty($message->homecountry)) { $country = array_search($message->homecountry, $countries); if ($country === false) { - $country = Horde_String::convertCharset($message->homecountry, 'utf-8', $charset); + $country = $message->homecountry; } $hash['homeCountry'] = $country; } elseif (!$message->isGhosted('homecountry')) { @@ -2539,7 +2516,7 @@ class Turba_Driver implements Countable if (!empty($message->businesscountry)) { $country = array_search($message->businesscountry, $countries); if ($country === false) { - $country = Horde_String::convertCharset($message->businesscountry, 'utf-8', $charset); + $country = $message->businesscountry; } $hash['workCountry'] = $country; } elseif (!$message->isGhosted('businesscountry')) { diff --git a/turba/lib/Driver/Ldap.php b/turba/lib/Driver/Ldap.php index 247e3c9f6..ec4200572 100644 --- a/turba/lib/Driver/Ldap.php +++ b/turba/lib/Driver/Ldap.php @@ -299,7 +299,7 @@ class Turba_Driver_Ldap extends Turba_Driver $this->_encodeAttributes($attributes); if (!@ldap_add($this->_ds, Horde_String::convertCharset($dn, 'UTF-8', $this->_params['charset']), $attributes)) { - throw new Turba_Exception('Failed to add an object: [' . ldap_errno($this->_ds) . '] "' . ldap_error($this->_ds) . '" DN: ' . $dn . ' (attributes: [' . serialize($attributes) . ']).' . "Charset:" . 'UTF-8'); + throw new Turba_Exception('Failed to add an object: [' . ldap_errno($this->_ds) . '] "' . ldap_error($this->_ds) . '" DN: ' . $dn . ' (attributes: [' . serialize($attributes) . ']).' . "Charset:UTF-8'); } } diff --git a/turba/lib/Object.php b/turba/lib/Object.php index 799478056..736741202 100644 --- a/turba/lib/Object.php +++ b/turba/lib/Object.php @@ -248,7 +248,7 @@ class Turba_Object { . ' ' . date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:i a', $entry['ts']) . ' ' - . @htmlspecialchars($by, ENT_COMPAT, 'UTF-8'); + . htmlspecialchars($by); } } } catch (Exception $e) { diff --git a/turba/lib/View/Browse.php b/turba/lib/View/Browse.php index 8acdba60b..edd048aa1 100644 --- a/turba/lib/View/Browse.php +++ b/turba/lib/View/Browse.php @@ -153,7 +153,7 @@ class Turba_View_Browse { try { $message = Horde::callHook('perms_denied', array('turba:max_contacts')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$targetSource]['title']), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$targetSource]['title'])); } $notification->push($message, 'horde.error', array('content.raw')); break; @@ -305,7 +305,7 @@ class Turba_View_Browse { try { $message = Horde::callHook('perms_denied', array('turba:max_contacts')); } catch (Horde_Exception $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title'])); } $notification->push($message, 'horde.error', array('content.raw')); break; diff --git a/turba/templates/common-header.inc b/turba/templates/common-header.inc index 566030a2e..679f150ba 100644 --- a/turba/templates/common-header.inc +++ b/turba/templates/common-header.inc @@ -1,7 +1,7 @@ diff --git a/turba/vcard.php b/turba/vcard.php index 489d77034..01ecc97cb 100644 --- a/turba/vcard.php +++ b/turba/vcard.php @@ -40,4 +40,4 @@ if (!$filename) { $filename = _("contact"); } -$injector->getInstance('Horde_Data')->getData('Vcard')->exportFile($filename . '.vcf', array($driver->tovCard($object, '2.1', null, true)), 'UTF-8'); +$injector->getInstance('Horde_Data')->getData('Vcard')->exportFile($filename . '.vcf', array($driver->tovCard($object, '2.1', null, true))); diff --git a/vilma/templates/common-header.inc b/vilma/templates/common-header.inc index 1f6b14452..835d61a45 100644 --- a/vilma/templates/common-header.inc +++ b/vilma/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/whups/lib/Driver/sql.php b/whups/lib/Driver/sql.php index ed4b58653..e31d1078c 100644 --- a/whups/lib/Driver/sql.php +++ b/whups/lib/Driver/sql.php @@ -84,9 +84,9 @@ class Whups_Driver_sql extends Whups_Driver { $values = array( $new_id, Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $slug, $email); Horde::logMessage( @@ -114,9 +114,9 @@ class Whups_Driver_sql extends Whups_Driver { ' (type_id, type_name, type_description) VALUES (?, ?, ?)'; $values = array($new_id, Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset'])); + $this->_params['charset'])); Horde::logMessage( sprintf('Whups_Driver_sql::addType(): query="%s"; values="%s"', $query, implode(',', $values)), 'DEBUG'); @@ -143,11 +143,11 @@ class Whups_Driver_sql extends Whups_Driver { $values = array($new_id, $typeId, Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($category, 'UTF-8', - $this->_params['charset'])); + $this->_params['charset'])); Horde::logMessage( sprintf('Whups_Driver_sql::addState(): query="%s"; values="%s"', $query, implode(',', $values)), 'DEBUG'); @@ -174,9 +174,9 @@ class Whups_Driver_sql extends Whups_Driver { $values = array($new_id, $typeId, Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset'])); + $this->_params['charset'])); Horde::logMessage( sprintf('Whups_Driver_sql::addPriority(): query="%s"; values="%s"', $query, implode(',', $values)), 'DEBUG'); diff --git a/whups/lib/Ticket.php b/whups/lib/Ticket.php index 8ca2731a1..867af66a9 100644 --- a/whups/lib/Ticket.php +++ b/whups/lib/Ticket.php @@ -740,8 +740,6 @@ class Whups_Ticket { $message_file .= '.txt'; /* Prepare message text. */ - $message = Horde_String::convertCharset(file_get_contents($message_file), - 'UTF-8'); $message = str_replace( array('@@ticket_url@@', '@@table@@', @@ -751,7 +749,7 @@ class Whups_Ticket { array($url, $table, $dont_reply, strftime($GLOBALS['prefs']->getValue('date_format')), $name), - $message); + file_get_contents($message_file)); /* Include Re: if the ticket isn't new for easy * filtering/eyeballing. */ diff --git a/whups/opensearch.php b/whups/opensearch.php index 5c0502622..c4fe46b4f 100644 --- a/whups/opensearch.php +++ b/whups/opensearch.php @@ -20,9 +20,7 @@ $name = $registry->get('name', 'whups') . ' (' . $url . ')'; $icon = base64_encode(file_get_contents($registry->get('themesfs', 'whups') . '/graphics/whups.png')); // Charset. -$charset = 'UTF-8'; - -header('Content-Type: text/xml; charset=' . $charset); +header('Content-Type: text/xml; charset=UTF-8'); echo << $name diff --git a/whups/query/rss.php b/whups/query/rss.php index 0c136755d..e86188595 100644 --- a/whups/query/rss.php +++ b/whups/query/rss.php @@ -55,7 +55,6 @@ foreach (array_keys($tickets) as $i) { } $template = $injector->createInstance('Horde_Template'); -$template->set('charset', 'UTF-8'); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); $template->set('pubDate', htmlspecialchars(date('r'))); $template->set('title', htmlspecialchars($whups_query->name ? $whups_query->name : _("Query Results"))); diff --git a/whups/queue/rss.php b/whups/queue/rss.php index 22e1f5d91..7a6ea0b49 100644 --- a/whups/queue/rss.php +++ b/whups/queue/rss.php @@ -86,7 +86,6 @@ foreach (array_keys($tickets) as $i) { } $template = $injector->createInstance('Horde_Template'); -$template->set('charset', 'UTF-8'); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); $template->set('pubDate', htmlspecialchars(date('r'))); if (isset($type) && isset($queue['name'])) { diff --git a/whups/search/rss.php b/whups/search/rss.php index 95751601d..bdb59ef26 100644 --- a/whups/search/rss.php +++ b/whups/search/rss.php @@ -47,7 +47,6 @@ foreach (array_keys($tickets) as $i) { } $template = $injector->createInstance('Horde_Template'); -$template->set('charset', 'UTF-8'); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); $template->set('pubDate', htmlspecialchars(date('r'))); $template->set('title', _("Search Results")); diff --git a/whups/templates/common-header.inc b/whups/templates/common-header.inc index 12b58f884..dd5ee2d18 100644 --- a/whups/templates/common-header.inc +++ b/whups/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/whups/ticket/rss.php b/whups/ticket/rss.php index c3293067a..12cec5ea2 100644 --- a/whups/ticket/rss.php +++ b/whups/ticket/rss.php @@ -42,7 +42,6 @@ foreach (array_keys($history) as $i) { } $template = $injector->createInstance('Horde_Template'); -$template->set('charset', 'UTF-8'); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); $template->set('pubDate', htmlspecialchars(date('r'))); $template->set('title', htmlspecialchars($details['summary'])); diff --git a/wicked/lib/Page/MergeOrRename.php b/wicked/lib/Page/MergeOrRename.php index e47f8a05e..ea2314b51 100644 --- a/wicked/lib/Page/MergeOrRename.php +++ b/wicked/lib/Page/MergeOrRename.php @@ -107,8 +107,8 @@ class MergeOrRename extends Wicked_Page { } foreach ($references as $key => $page) { - $references[$key]['page_url'] = @htmlspecialchars(Wicked::url($page['page_name']), ENT_QUOTES, 'UTF-8'); - $references[$key]['page_name'] = @htmlspecialchars($page['page_name'], ENT_QUOTES, 'UTF-8'); + $references[$key]['page_url'] = htmlspecialchars(Wicked::url($page['page_name'])); + $references[$key]['page_name'] = htmlspecialchars($page['page_name']); // Since the page name can have [ and ] and other special // characters in it, and we don't want the browser or PHP decoding diff --git a/wicked/lib/Text_Wiki/Render/Xhtml/Code2.php b/wicked/lib/Text_Wiki/Render/Xhtml/Code2.php index 0b31989cf..0e0a1d9dc 100644 --- a/wicked/lib/Text_Wiki/Render/Xhtml/Code2.php +++ b/wicked/lib/Text_Wiki/Render/Xhtml/Code2.php @@ -20,7 +20,7 @@ class Text_Wiki_Render_Xhtml_Code2 extends Text_Wiki_Render_Xhtml_Code $part->setContents($options['text']); $part->setType("x-extension/$type"); - $viewer = new Horde_Core_Mime_Viewer_Syntaxhighlighter($part, array('registry' => $GLOBALS['registry'], 'charset' => 'UTF-8')); + $viewer = new Horde_Core_Mime_Viewer_Syntaxhighlighter($part); $data = $viewer->render('inline'); $data = reset($data); return $data['data']; diff --git a/wicked/opensearch.php b/wicked/opensearch.php index 80dd36eb9..5483bc215 100644 --- a/wicked/opensearch.php +++ b/wicked/opensearch.php @@ -24,9 +24,7 @@ $name = $registry->get('name', 'wicked') . ' (' . $url . ')'; $icon = base64_encode(file_get_contents($registry->get('themesfs', 'wicked') . '/graphics/wicked.png')); // Charset. -$charset = 'UTF-8'; - -header('Content-Type: text/xml; charset=' . $charset); +header('Content-Type: text/xml; charset=UTF-8'); echo << $name @@ -38,7 +36,7 @@ echo << data:image/png;base64,$icon - $charset + UTF-8 PAYLOAD; diff --git a/wicked/templates/common-header.inc b/wicked/templates/common-header.inc index 314679e4e..19da3f3cf 100644 --- a/wicked/templates/common-header.inc +++ b/wicked/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/wicked/templates/edit/new.inc b/wicked/templates/edit/new.inc index 1abee7298..51420e898 100644 --- a/wicked/templates/edit/new.inc +++ b/wicked/templates/edit/new.inc @@ -26,7 +26,7 @@ function preview()
- +
diff --git a/wicked/templates/edit/standard.inc b/wicked/templates/edit/standard.inc index 621cb088b..7bfa261fa 100644 --- a/wicked/templates/edit/standard.inc +++ b/wicked/templates/edit/standard.inc @@ -45,7 +45,7 @@ if (!empty($GLOBALS['conf']['wicked']['captcha']) && !$GLOBALS['registry']->getA
- +
diff --git a/wicked/templates/history/summary.inc b/wicked/templates/history/summary.inc index 956500552..e4158ff02 100644 --- a/wicked/templates/history/summary.inc +++ b/wicked/templates/history/summary.inc @@ -40,5 +40,5 @@ if ($show_restore) {
- +
- +   diff --git a/jeta/templates/common-header.inc b/jeta/templates/common-header.inc index 4c9a50709..cab2d7120 100644 --- a/jeta/templates/common-header.inc +++ b/jeta/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/jonah/delivery/rss.php b/jonah/delivery/rss.php index 01bd5d800..11fc7b5a6 100644 --- a/jonah/delivery/rss.php +++ b/jonah/delivery/rss.php @@ -65,22 +65,21 @@ try { // Build the template (@TODO: Use Horde_View) $template = new Horde_Template(); -$template->set('charset', 'UTF-8'); $template->set('jonah', 'Jonah ' . $registry->getVersion() . ' (http://www.horde.org/jonah/)'); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); if (!empty($criteria['tag_id'])) { - $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8'))); + $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, htmlspecialchars($channel['channel_name']))); } else { - $template->set('channel_name', @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8')); + $template->set('channel_name', htmlspecialchars($channel['channel_name'])); } -$template->set('channel_desc', @htmlspecialchars($channel['channel_desc'], ENT_COMPAT, 'UTF-8')); +$template->set('channel_desc', htmlspecialchars($channel['channel_desc'])); $template->set('channel_updated', htmlspecialchars(date('r', $channel['channel_updated']))); $template->set('channel_official', htmlspecialchars($channel['channel_official'])); $template->set('channel_rss', htmlspecialchars(Horde_Util::addParameter(Horde::url('delivery/rss.php', true, -1), array('type' => 'rss', 'channel_id' => $channel['channel_id'])))); $template->set('channel_rss2', htmlspecialchars(Horde_Util::addParameter(Horde::url('delivery/rss.php', true, -1), array('type' => 'rss2', 'channel_id' => $channel['channel_id'])))); foreach ($stories as &$story) { - $story['title'] = @htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8'); - $story['description'] = @htmlspecialchars($story['description'], ENT_COMPAT, 'UTF-8'); + $story['title'] = htmlspecialchars($story['title']); + $story['description'] = htmlspecialchars($story['description']); $story['permalink'] = htmlspecialchars($story['permalink']); $story['published'] = htmlspecialchars(date('r', $story['published'])); if (!empty($story['body_type']) && $story['body_type'] == 'text') { diff --git a/jonah/lib/Block/latest.php b/jonah/lib/Block/latest.php index cd1b19cfc..536598752 100644 --- a/jonah/lib/Block/latest.php +++ b/jonah/lib/Block/latest.php @@ -56,13 +56,13 @@ class Horde_Block_Jonah_latest extends Horde_Block try { $story = $this->_fetch(); } catch (Exception $e) { - return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8'); + return htmlspecialchars($e->getMessage()); } return ' ' - . @htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8'); + . htmlspecialchars($story['title']); } /** diff --git a/jonah/lib/Block/news.php b/jonah/lib/Block/news.php index 4aa09626d..0b665637f 100644 --- a/jonah/lib/Block/news.php +++ b/jonah/lib/Block/news.php @@ -59,15 +59,15 @@ class Horde_Block_Jonah_news extends Horde_Block { try { $channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($this->_params['source']); } catch (Jonah_Exception $e) { - return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8'); + return htmlspecialchars($e->getMessage()); } if (!empty($channel['channel_link'])) { $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank') - . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8') + . htmlspecialchars($channel['channel_name']) . ''; } else { - $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8'); + $title = htmlspecialchars($channel['channel_name']); } return $title; diff --git a/jonah/lib/Block/news_popular.php b/jonah/lib/Block/news_popular.php index 40cfbbdb0..26c8776bc 100644 --- a/jonah/lib/Block/news_popular.php +++ b/jonah/lib/Block/news_popular.php @@ -56,15 +56,15 @@ class Horde_Block_Jonah_news_popular extends Horde_Block { try { $channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($this->_params['source']); } catch (Exception $e) { - return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8'); + return htmlspecialchars($e->getMessage()); } if (!empty($channel['channel_link'])) { $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank') - . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8') + . htmlspecialchars($channel['channel_name']) . _(" - Most read stories") . ''; } else { - $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8') + $title = htmlspecialchars($channel['channel_name']) . _(" - Most read stories"); } diff --git a/jonah/lib/Block/story.php b/jonah/lib/Block/story.php index d5d32c5a4..461f08953 100644 --- a/jonah/lib/Block/story.php +++ b/jonah/lib/Block/story.php @@ -57,12 +57,12 @@ class Horde_Block_Jonah_story extends Horde_Block { try { $story = $this->_fetch(); } catch (Jonah_Exception $e) { - return htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8'); + return htmlspecialchars($e->getMessage()); } return ' ' - . htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8'); + . htmlspecialchars($story['title']); } /** diff --git a/jonah/templates/common-header.inc b/jonah/templates/common-header.inc index dd26f7d8a..22049bed4 100644 --- a/jonah/templates/common-header.inc +++ b/jonah/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/kastalia/templates/common-header.inc b/kastalia/templates/common-header.inc index 1a7d8d154..ea8965e69 100755 --- a/kastalia/templates/common-header.inc +++ b/kastalia/templates/common-header.inc @@ -1,6 +1,6 @@ diff --git a/koward/lib/Koward/View/shared/_header.html.php b/koward/lib/Koward/View/shared/_header.html.php index 9735801b0..4257c1b76 100644 --- a/koward/lib/Koward/View/shared/_header.html.php +++ b/koward/lib/Koward/View/shared/_header.html.php @@ -1,6 +1,6 @@ diff --git a/koward/www/horde/config/nls.php.dist b/koward/www/horde/config/nls.php.dist index 0baa4af7e..ff755928d 100644 --- a/koward/www/horde/config/nls.php.dist +++ b/koward/www/horde/config/nls.php.dist @@ -125,7 +125,6 @@ $nls['charsets']['bg_BG'] = 'windows-1251'; $nls['charsets']['bs_BA'] = 'ISO-8859-2'; $nls['charsets']['cs_CZ'] = 'ISO-8859-2'; $nls['charsets']['el_GR'] = 'ISO-8859-7'; -$nls['charsets']['eu_ES'] = 'UTF-8'; $nls['charsets']['fa_IR'] = 'UTF-8'; $nls['charsets']['he_IL'] = 'UTF-8'; $nls['charsets']['hu_HU'] = 'ISO-8859-2'; diff --git a/koward/www/htdocs/koward/themes/kolab/screen.css b/koward/www/htdocs/koward/themes/kolab/screen.css index 017e2a774..4a871de92 100644 --- a/koward/www/htdocs/koward/themes/kolab/screen.css +++ b/koward/www/htdocs/koward/themes/kolab/screen.css @@ -1,8 +1,3 @@ -/* - Local variables: - buffer-file-coding-system: utf-8 - End: -*/ body { color: black; background-color: #F8FCF8; diff --git a/kronolith/add.php b/kronolith/add.php index 05ad79e4e..41907c630 100644 --- a/kronolith/add.php +++ b/kronolith/add.php @@ -54,7 +54,7 @@ do { try { $message = Horde::callHook('perms_denied', array('kronolith:max_events')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events'))); } $GLOBALS['notification']->push($message, 'horde.error', array('content.raw')); break; diff --git a/kronolith/data.php b/kronolith/data.php index 5b54759de..c15748321 100644 --- a/kronolith/data.php +++ b/kronolith/data.php @@ -46,7 +46,7 @@ if ($perms->hasAppPermission('max_events') !== true && try { $message = Horde::callHook('perms_denied', array('kronolith:max_events')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events'))); } $notification->push($message, 'horde.warning', array('content.raw')); $templates[Horde_Data::IMPORT_FILE] = array(KRONOLITH_TEMPLATES . '/data/export.inc'); @@ -182,7 +182,7 @@ case 'export': $calNames[] = $share->get('name'); } - $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), 'UTF-8', 'utf-8')); + $iCal->setAttribute('X-WR-CALNAME', implode(', ', $calNames))); $data = $iCal->exportvCalendar(); $browser->downloadHeaders(_("events.ics"), 'text/calendar', false, strlen($data)); echo $data; @@ -264,7 +264,7 @@ if (is_array($next_step)) { try { $message = Horde::callHook('perms_denied', array('kronolith:max_events')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events'))); } $notification->push($message, 'horde.error', array('content.raw')); break; @@ -340,7 +340,7 @@ if (is_array($next_step)) { if (Horde_Util::getFormData('import_ajax')) { $stack = $notification->notify(array('listeners' => 'status', 'raw' => true)); if ($stack) { - Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON, 'UTF-8') . '));'); + Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON) . '));'); } Horde::addInlineScript('window.parent.$(window.name).remove();'); Horde::outputInlineScript(); diff --git a/kronolith/edit.php b/kronolith/edit.php index c32e76de7..cf3f2f0fb 100644 --- a/kronolith/edit.php +++ b/kronolith/edit.php @@ -31,7 +31,7 @@ function _check_max() try { $message = Horde::callHook('perms_denied', array('kronolith:max_events')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events'))); } $GLOBALS['notification']->push($message, 'horde.error', array('content.raw')); return false; diff --git a/kronolith/feed/index.php b/kronolith/feed/index.php index fcb499ec9..259827c50 100644 --- a/kronolith/feed/index.php +++ b/kronolith/feed/index.php @@ -91,17 +91,16 @@ $history = $injector->getInstance('Horde_History'); $now = new Horde_Date(time()); $template = $injector->createInstance('Horde_Template'); -$template->set('charset', 'UTF-8'); $template->set('updated', $now->format(DATE_ATOM)); $template->set('kronolith_name', 'Kronolith'); $template->set('kronolith_version', $registry->getVersion()); $template->set('kronolith_uri', 'http://www.horde.org/kronolith/'); $template->set('kronolith_icon', Horde::url(Horde_Themes::img('kronolith.png'), true, -1)); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); -$template->set('calendar_name', @htmlspecialchars($share->get('name'), ENT_COMPAT, 'UTF-8')); -$template->set('calendar_desc', @htmlspecialchars($share->get('desc'), ENT_COMPAT, 'UTF-8'), true); -$template->set('calendar_owner', @htmlspecialchars($identity->getValue('fullname'), ENT_COMPAT, 'UTF-8')); -$template->set('calendar_email', @htmlspecialchars($identity->getValue('from_addr'), ENT_COMPAT, 'UTF-8'), true); +$template->set('calendar_name', htmlspecialchars($share->get('name'))); +$template->set('calendar_desc', htmlspecialchars($share->get('desc')), true); +$template->set('calendar_owner', htmlspecialchars($identity->getValue('fullname'))); +$template->set('calendar_email', htmlspecialchars($identity->getValue('from_addr')), true); $template->set('self_url', $self_url); $twentyFour = $prefs->getValue('twentyFor'); @@ -117,7 +116,7 @@ foreach ($events as $day_events) { } $modified = new Horde_Date($modified); /* Description. */ - $desc = @htmlspecialchars($event->description, ENT_COMPAT, 'UTF-8'); + $desc = htmlspecialchars($event->description); if (strlen($desc)) { $desc .= '

'; } @@ -134,15 +133,15 @@ foreach ($events as $day_events) { $attendees[] = empty($status['name']) ? $attendee : Horde_Mime_Address::trimAddress($status['name'] . (strpos($attendee, '@') === false ? '' : ' <' . $attendee . '>')); } if (count($attendees)) { - $desc .= '
' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, 'UTF-8'); + $desc .= '
' . _("Who:") . ' ' . htmlspecialchars(implode(', ', $attendees)); } if (strlen($event->location)) { - $desc .= '
' . _("Where:") . ' ' . @htmlspecialchars($event->location, ENT_COMPAT, 'UTF-8'); + $desc .= '
' . _("Where:") . ' ' . htmlspecialchars($event->location); } $desc .= '
' . _("Event Status:") . ' ' . Kronolith::statusToString($event->status); - $entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, 'UTF-8'); - $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, 'UTF-8'); + $entries[$id]['title'] = htmlspecialchars($event->getTitle()); + $entries[$id]['desc'] = htmlspecialchars($desc); $entries[$id]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1)); $entries[$id]['modified'] = $modified->format(DATE_ATOM); } diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index 7b075dd30..73fa82e54 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -100,7 +100,7 @@ class Kronolith_Ajax_Application extends Horde_Core_Ajax_Application try { $message = Horde::callHook('perms_denied', array('kronolith:max_events')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events'))); } $GLOBALS['notification']->push($message, 'horde.error', array('content.raw')); return $result; diff --git a/kronolith/lib/Api.php b/kronolith/lib/Api.php index 2a5245f8d..c99d6ab70 100644 --- a/kronolith/lib/Api.php +++ b/kronolith/lib/Api.php @@ -785,7 +785,7 @@ class Kronolith_Api extends Horde_Registry_Api $share = $kronolith_shares->getShare($event->calendar); $iCal = new Horde_Icalendar($version); - $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'utf-8')); + $iCal->setAttribute('X-WR-CALNAME', $share->get('name')); // Create a new vEvent. $iCal->addComponent($event->toiCalendar($iCal)); @@ -835,9 +835,9 @@ class Kronolith_Api extends Horde_Registry_Api $share = $kronolith_shares->getShare($calendar); $iCal = new Horde_Icalendar($version); - $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'UTF-8')); + $iCal->setAttribute('X-WR-CALNAME', $share->get('name')); if (strlen($share->get('desc'))) { - $iCal->setAttribute('X-WR-CALDESC', Horde_String::convertCharset($share->get('desc'), 'UTF-8', 'UTF-8')); + $iCal->setAttribute('X-WR-CALDESC', $share->get('desc')); } foreach ($events as $dayevents) { diff --git a/kronolith/lib/Application.php b/kronolith/lib/Application.php index d84ca63ac..d26a0bb3c 100644 --- a/kronolith/lib/Application.php +++ b/kronolith/lib/Application.php @@ -523,7 +523,7 @@ class Kronolith_Application extends Horde_Registry_Application $tree->addNode( $parent . $calId . $event->id, $parent, - htmlspecialchars($event->getTitle(), ENT_COMPAT, 'UTF-8'), + htmlspecialchars($event->getTitle()), 1, false, array( diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 4aa4d89d6..e6e0a83c2 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -560,17 +560,14 @@ abstract class Kronolith_Event $vEvent->setAttribute('LAST-MODIFIED', $modified); } - $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), 'UTF-8', 'utf-8')); + $vEvent->setAttribute('SUMMARY', $this->getTitle()); $name = Kronolith::getUserName($this->creator); - if (!$v1) { - $name = Horde_String::convertCharset($name, 'UTF-8', 'utf-8'); - } $vEvent->setAttribute('ORGANIZER', 'mailto:' . Kronolith::getUserEmail($this->creator), array('CN' => $name)); if (!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) { if (!empty($this->description)) { - $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, 'UTF-8', 'utf-8')); + $vEvent->setAttribute('DESCRIPTION', $this->description); } // Tags @@ -579,12 +576,12 @@ abstract class Kronolith_Event $tags = implode(', ', $tags); } if (!empty($tags)) { - $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, 'UTF-8', 'utf-8')); + $vEvent->setAttribute('CATEGORIES', $tags); } // Location if (!empty($this->location)) { - $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, 'UTF-8', 'utf-8')); + $vEvent->setAttribute('LOCATION', $this->location); } if ($this->geoLocation) { $vEvent->setAttribute('GEO', array('latitude' => $this->geoLocation['lat'], 'longitude' => $this->geoLocation['lon'])); @@ -702,7 +699,7 @@ abstract class Kronolith_Event } } else { if (!empty($status['name'])) { - $params['CN'] = Horde_String::convertCharset($status['name'], 'UTF-8', 'utf-8'); + $params['CN'] = $status['name']; } if (!empty($email)) { $email = 'mailto:' . $email; @@ -1104,19 +1101,17 @@ abstract class Kronolith_Event */ public function fromASAppointment(Horde_ActiveSync_Message_Appointment $message) { - $charset = 'UTF-8'; - /* New event? */ if ($this->id === null) { $this->creator = $GLOBALS['registry']->getAuth(); } - if ($title = Horde_String::convertCharset($message->getSubject(), 'utf-8', $charset)) { + if (strlen($title = $message->getSubject())) { $this->title = $title; } - if ($description = Horde_String::convertCharset($message->getBody(), 'utf-8', $charset)) { + if (strlen($description = $message->getBody())) { $this->description = $description; } - if ($location = Horde_String::convertCharset($message->getLocation(), 'utf-8', $charset)) { + if (strlen($location = $message->getLocation())) { $this->location = $location; } @@ -1190,8 +1185,8 @@ abstract class Kronolith_Event $event->start = $times['start']; $event->end = $times['end']; $event->allday = $times['allday']; - $event->title = Horde_String::convertCharset($rule->getSubject(), 'utf-8', $charset); - $event->description = Horde_String::convertCharset($rule->getBody(), 'utf-8', $charset); + $event->title = $rule->getSubject(); + $event->description = $rule->getBody(); $event->baseid = $this->uid; $event->exceptionoriginaldate = $original; $event->initialized = true; @@ -1208,16 +1203,16 @@ abstract class Kronolith_Event $attendees = $message->getAttendees(); foreach ($attendees as $attendee) { // TODO: participation and response are not supported in AS <= 2.5 - $this->addAttendee(Horde_String::convertCharset($attendee->email, 'utf-8', $charset), + $this->addAttendee($attendee->email, Kronolith::PART_NONE, Kronolith::RESPONSE_NONE, - Horde_String::convertCharset($attendee->name, 'utf-8', $charset)); + $attendee->name); } /* Categories (Tags) */ $tags = $message->getCategories(); foreach ($tags as $tag) { - $this->tags[] = Horde_String::convertCharset($tag, 'utf-8', $charset); + $this->tags[] = $tag; } /* Flag that we are initialized */ @@ -1231,12 +1226,10 @@ abstract class Kronolith_Event */ public function toASAppointment() { - $charset = 'UTF-8'; - $message = new Horde_ActiveSync_Message_Appointment(array('logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger'))); - $message->setSubject(Horde_String::convertCharset($this->getTitle(), $charset, 'utf-8')); - $message->setBody(Horde_String::convertCharset($this->description, $charset, 'utf-8')); - $message->setLocation(Horde_String::convertCharset($this->location, $charset, 'utf-8')); + $message->setSubject($this->getTitle()); + $message->setBody($this->description); + $message->setLocation($this->location); /* Start and End */ $message->setDatetime(array('start' => $this->start, @@ -1247,10 +1240,10 @@ abstract class Kronolith_Event $message->setTimezone($this->start); /* Organizer */ - $name = Horde_String::convertCharset(Kronolith::getUserName($this->creator), $charset, 'utf-8'); + $name = Kronolith::getUserName($this->creator); $message->setOrganizer( array('name' => $name, - 'email' => Horde_String::convertCharset(Kronolith::getUserEmail($this->creator), $charset, 'utf-8')) + 'email' => Kronolith::getUserEmail($this->creator)) ); /* Privacy */ @@ -1312,9 +1305,9 @@ abstract class Kronolith_Event } /* Remaining properties that could be different */ - $e->setSubject(Horde_String::convertCharset($exception->getTitle(), $charset, 'utf-8')); - $e->setLocation(Horde_String::convertCharset($exception->location, $charset, 'utf-8')); - $e->setBody(Horde_String::convertCharset($exception->description, $charset, 'utf-8')); + $e->setSubject($exception->getTitle()); + $e->setLocation($exception->location); + $e->setBody($exception->description); $e->setSensitivity($exception->private ? Horde_ActiveSync_Message_Appointment::SENSITIVITY_PRIVATE : @@ -1340,7 +1333,7 @@ abstract class Kronolith_Event /* Tags/Categories */ foreach ($exception->tags as $tag) { - $e->addCategory(Horde_String::convertCharset($tag, $charset, 'utf-8')); + $e->addCategory($tag); } $message->addexception($e); @@ -1362,7 +1355,7 @@ abstract class Kronolith_Event $message->setMeetingStatus(Horde_ActiveSync_Message_Appointment::MEETING_IS_MEETING); foreach ($this->attendees as $email => $properties) { $attendee = new Horde_ActiveSync_Message_Attendee(); - $attendee->email = Horde_String::convertCharset($email, $charset, 'utf-8'); + $attendee->email = $email; // AS only as required or opitonal //$attendee->type = ($properties['attendance'] !== Kronolith::PART_REQUIRED ? Kronolith::PART_OPTIONAL : Kronolith::PART_REQUIRED); //$attendee->status = $properties['response']; @@ -1387,7 +1380,7 @@ abstract class Kronolith_Event /* Categories (tags) */ foreach ($this->tags as $tag) { - $message->addCategory(Horde_String::convertCharset($tag, $charset, 'utf-8')); + $message->addCategory($tag); } return $message; @@ -2023,7 +2016,7 @@ abstract class Kronolith_Event // Convert IDN hosts to ASCII. if (function_exists('idn_to_ascii')) { $old_error = error_reporting(0); - $url['host'] = idn_to_ascii(Horde_String::convertCharset($url['host'], 'UTF-8', 'UTF-8')); + $url['host'] = idn_to_ascii($url['host']); error_reporting($old_error); } elseif (Horde_Mime::is8bit($url['host'])) { //throw new Kronolith_Exception(_("Invalid character in URL.")); @@ -2639,7 +2632,7 @@ abstract class Kronolith_Event '', array('style' => $this->getCSSColors(false))); } - $link .= @htmlspecialchars($event_title, ENT_QUOTES, 'UTF-8'); + $link .= htmlspecialchars($event_title); if ($read_permission && $view_url) { $link .= ''; } diff --git a/kronolith/lib/Event/Holidays.php b/kronolith/lib/Event/Holidays.php index c589e2144..852b5b113 100644 --- a/kronolith/lib/Event/Holidays.php +++ b/kronolith/lib/Event/Holidays.php @@ -42,7 +42,7 @@ class Kronolith_Event_Holidays extends Kronolith_Event { $this->stored = true; $this->initialized = true; - $this->title = Horde_String::convertCharset($dhEvent->getTitle(), 'UTF-8'); + $this->title = $dhEvent->getTitle() $this->start = new Horde_Date($dhEvent->_date->getTime()); $this->end = new Horde_Date($this->start); $this->end->mday++; diff --git a/kronolith/lib/FreeBusy.php b/kronolith/lib/FreeBusy.php index 1feb14994..31ee39652 100644 --- a/kronolith/lib/FreeBusy.php +++ b/kronolith/lib/FreeBusy.php @@ -194,13 +194,11 @@ class Kronolith_FreeBusy $contentType = $http->getResponseHeader('Content-Type'); if ($contentType && strpos($contentType, ';') !== false) { list(,$charset,) = explode(';', $contentType); - $charset = trim(str_replace('charset=', '', $charset)); - } else { - $charset = 'UTF-8'; + $data = Horde_String::convertCharset($data, trim(str_replace('charset=', '', $charset)), 'UTF-8'); } $vCal = new Horde_Icalendar(); - $vCal->parsevCalendar($data, 'VCALENDAR', $charset); + $vCal->parsevCalendar($data, 'VCALENDAR'); $components = $vCal->getComponents(); $vCal = new Horde_Icalendar(); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index b62a3e5ac..9630e0559 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -79,7 +79,7 @@ class Kronolith Horde_Core_Ui_JsCalendar::init(array('short_weekdays' => true)); if (isset($GLOBALS['language'])) { - header('Content-type: text/html; charset=' . 'UTF-8'); + header('Content-type: text/html; charset=UTF-8'); header('Vary: Accept-Language'); } @@ -333,7 +333,7 @@ class Kronolith // Maps $code['conf']['maps'] = $GLOBALS['conf']['maps']; - return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, 'UTF-8') . ';'); + return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON) . ';'); } /** @@ -2316,7 +2316,7 @@ class Kronolith /* Build the iCalendar data */ $iCal = new Horde_Icalendar(); $iCal->setAttribute('METHOD', $method); - $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'utf-8')); + $iCal->setAttribute('X-WR-CALNAME', $share->get('name')); $vevent = $event->toiCalendar($iCal); if ($action == self::ITIP_CANCEL && !empty($instance)) { // Recurring event instance deletion, need to specify the diff --git a/kronolith/lib/View/ExportEvent.php b/kronolith/lib/View/ExportEvent.php index 856986a3c..cd64e46b8 100644 --- a/kronolith/lib/View/ExportEvent.php +++ b/kronolith/lib/View/ExportEvent.php @@ -27,11 +27,7 @@ class Kronolith_View_ExportEvent { if ($event->calendarType == 'internal') { try { $share = $GLOBALS['kronolith_shares']->getShare($event->calendar); - $iCal->setAttribute( - 'X-WR-CALNAME', - Horde_String::convertCharset($share->get('name'), - 'UTF-8', - 'utf-8')); + $iCal->setAttribute('X-WR-CALNAME', $share->get('name')); } catch (Exception $e) { } } @@ -41,7 +37,7 @@ class Kronolith_View_ExportEvent { $GLOBALS['browser']->downloadHeaders( $event->getTitle() . '.ics', - 'text/calendar; charset=' . 'UTF-8', + 'text/calendar; charset=UTF-8', true, strlen($content)); echo $content; exit; diff --git a/kronolith/new.php b/kronolith/new.php index a8aaf7075..dd21a8699 100644 --- a/kronolith/new.php +++ b/kronolith/new.php @@ -26,7 +26,7 @@ if ($perms->hasAppPermission('max_events') !== true && try { $message = Horde::callHook('perms_denied', array('kronolith:max_events')); } catch (Horde_Exception_HookNotSet $e) { - $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8'); + $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events'))); } $notification->push($message, 'horde.error', array('content.raw')); $url->redirect(); diff --git a/kronolith/templates/common-header.inc b/kronolith/templates/common-header.inc index 168fef538..a7993c3a0 100644 --- a/kronolith/templates/common-header.inc +++ b/kronolith/templates/common-header.inc @@ -5,7 +5,7 @@ Horde::addScriptFile('views.js', 'kronolith'); Horde::addScriptFile('stripe.js', 'horde'); if (isset($language)) { - header('Content-type: text/html; charset=' . 'UTF-8'); + header('Content-type: text/html; charset=UTF-8'); header('Vary: Accept-Language'); } ?> diff --git a/kronolith/templates/javascript_defs.php b/kronolith/templates/javascript_defs.php index ae866485a..b20c19d11 100644 --- a/kronolith/templates/javascript_defs.php +++ b/kronolith/templates/javascript_defs.php @@ -3,7 +3,6 @@ * JavaScript variables for the traditional interface. */ -$charset = 'UTF-8'; $currentDate = Kronolith::currentDate(); /* Variables used in core javascript files. */ @@ -25,7 +24,7 @@ $gettext = array( ?> diff --git a/kronolith/templates/view/view.inc b/kronolith/templates/view/view.inc index 5d2a308c4..500c0442b 100644 --- a/kronolith/templates/view/view.inc +++ b/kronolith/templates/view/view.inc @@ -26,7 +26,7 @@
  
  strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, 'UTF-8') ?>strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . htmlspecialchars($createdby) ?>
  strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, 'UTF-8') ?>strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . htmlspecialchars($modifiedby) ?>
getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, 'UTF-8') ?>getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . htmlspecialchars($createdby) ?>
getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, 'UTF-8') ?>getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . htmlspecialchars($modifiedby) ?>
changeLog(), ENT_COMPAT, 'UTF-8') ?>changeLog()) ?>