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;
}
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']));
$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);
$forums = Agora_Messages::singleton($scope);
$forums_list = $forums->getForums(0, true, 'forum_name', 0);
- $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($title) . '</title>
$cache->set($cache_key, $rss);
}
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
echo $rss;
exit;
}
- $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($message['message_subject']) . '</title>
$cache->set($cache_key, $rss);
}
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
echo $rss;
$threads_list = $threads->getThreads(0, false, 'message_modifystamp', 1, true, '', null, 0, 10);
- $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($title) . '</title>
$cache->set($cache_key, $rss);
}
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
echo $rss;
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
echo Horde::menu();
$notification->notify(array('listeners' => 'status'));
?>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
<div class="instructions">
<form action="sort.php" method="post">
<?php echo Horde_Util::formInput() ?>
<?php
$images = $gallery->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 '<div id="o_' . (int)$image->id . '"><a title="'
. $caption . '" href="#">'
. '<img src="' . Ansel::getImageUrl($image->id, 'thumb', false, $style) . '" alt="' . htmlspecialchars($image->filename) . '" />'
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. */
/* 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();
$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. */
// Check for an active image
if (!empty($image_id)) {
- $text = '<span class="thiscrumb" id="PhotoName">' . htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8') . '</span>';
+ $text = '<span class="thiscrumb" id="PhotoName">' . htmlspecialchars($image->filename) . '</span>';
$nav = $separator . $text . $nav;
$levels++;
}
}
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 . '</a>' . $nav;
'slug' => $gallery->get('slug')),
true);
- return $viewurl->link()
- . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8')
- . '</a>';
+ return $viewurl->link() . htmlspecialchars($name) . '</a>';
}
/**
$html .= '<tr><td>'
. $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') . '</a></td><td>'
+ . htmlspecialchars($gallery->get('name')) . '</a></td><td>'
. strftime($GLOBALS['prefs']->getValue('date_format'), $gallery->get('last_modified'))
. '</td><td>' . (int)$gallery->countImages(true) . '</td></tr>';
}
}
// 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,
$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 .= '<a href="' . Ansel_Faces::getLink($face) . '" title="' . $facename . '">'
. '<img src="' . $faces->getFaceUrl($face['image_id'], $face_id)
. '" style="padding-bottom: 5px; padding-left: 5px" alt="' . $facename . '" /></a>';
return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . '</a>';
}
- $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'),
'view' => 'Gallery'),
true);
$galleryLink = $galleryLink->link()
- . @htmlspecialchars($gallery->get('name'), ENT_COMPAT,
- 'UTF-8')
+ . htmlspecialchars($gallery->get('name'))
. '</a>';
$caption = substr($image->caption, 0, 30);
. $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)
. '</a></td><td class="nowrap">' . $galleryLink . '</td></tr>';
}
$html .= '</tbody></table>';
$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'));
$output[$field] = $value;
} else {
$description = isset($data['description']) ? $data['description'] : $field;
- $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</td>';
+ $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value) . '</td>';
}
}
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);
}
if (count($json)) {
- return Horde_Serialize::serialize($json, Horde_Serialize::JSON, 'UTF-8');
- } else {
- return '';
+ return Horde_Serialize::serialize($json, Horde_Serialize::JSON);
}
+
+ return '';
}
/**
/* Variables used in the template file */
$image_link = $view_link . $gallery_image . '</a>';
- $text_link = $view_link . htmlspecialchars($caption, ENT_COMPAT, 'UTF-8') . '</a>';
+ $text_link = $view_link . htmlspecialchars($caption) . '</a>';
$gallery_count = $dgallery->countImages(true);
/* Background color is needed if displaying a mini tile */
}
$image_link = $view_link . $gallery_image . '</a>';
- $text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8')
+ $text_link = $view_link . htmlspecialchars($gallery->get('name'))
. '</a>';
if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) && !$mini) {
if (empty($owner_string)) {
$owner_string = $gallery->get('owner');
}
- $owner_link .= htmlspecialchars($owner_string, ENT_COMPAT, 'UTF-8') . '</a>';
+ $owner_link .= htmlspecialchars($owner_string) . '</a>';
}
$gallery_count = $gallery->countImages(true);
}
$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);
$json[] = $data;
}
- return Horde_Serialize::serialize($json, Horde_Serialize::JSON, 'UTF-8');
+ return Horde_Serialize::serialize($json, Horde_Serialize::JSON);
}
/**
$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")) . '</a>';
$slug = $this->_view->gallery->get('slug');
- $html .= '<br />' . 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')) . '</a>';
+ $html .= '<br />' . 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'))) . '</a>';
/* Embed html */
if (empty($this->_view->_params['image_id'])) {
}
}
- $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']);
<input type="hidden" name="day" value="<?php echo (empty($date['day']) ? 0 : $date['day']) ?>" />
<h1 class="header">
- <?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?>
+ <?php echo htmlspecialchars($title) ?>
</h1>
<?php if ($gallery->get('desc')): ?>
echo '<td width="10%" align="right" valign="top">';
echo '<img src="' . $thumb_url . '" alt="' . htmlspecialchars($image->filename) . '" />' .
'</td><td width="40%" valign="top"><textarea name="img' . $image->id . '" rows="5" cols="25">' .
- htmlspecialchars($image->caption, ENT_COMPAT, 'UTF-8') . '</textarea></td>';
+ htmlspecialchars($image->caption) . '</textarea></td>';
$count++;
if (($count % 2) == 0) {
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
Horde::includeScriptFiles();
?>
-<title><?php echo htmlspecialchars($page_title, ENT_COMPAT, 'UTF-8') ?></title>
+<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
<?php echo Ansel::stylesheetLinks() ?>
<?php echo Horde::wrapInlineScript(Ansel::initJSVars());?>
<?php echo $pager->render() ?>
<script type="text/javascript">
//<![CDATA[
-var imgids = <?php echo Horde_Serialize::serialize($imageids, Horde_Serialize::JSON, 'UTF-8'); ?>;
+var imgids = <?php echo Horde_Serialize::serialize($imageids, Horde_Serialize::JSON); ?>;
function proccessImageFaces(image_id, reget) {
var url = '<?php echo Horde::url('faces/image.php'); ?>';
}
</script>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
<div class="control anselActions" style="text-align: center">
<?php
$image_src = Ansel::getImageUrl($image_id, 'full');
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
<div class="control anselActions" style="text-align: center">
<div id="prevDiv"></div>
<?php
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
<?php
$base_url = Horde::url('image.php');
$base_url = $base_url->copy()->add(array_merge(
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
<?php
$base_url = Horde::url('image.php')->add(
array_merge(
document.slider.setValue(<?php echo $geometry['height'] ?>);
}
</script>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
<div class="control anselActions" style="text-align: center">
<?php
$image_src = Ansel::getImageUrl($image_id, 'full');
<span class="rightFloat">
<?php ($galleries_perpage < $num_galleries) ? printf(_("%d to %d of %d Galleries"), $start, $end, $num_galleries) : printf(ngettext("%d Gallery", "%d Galleries", $num_galleries), $num_galleries) ?>
</span>
- <?php echo @htmlspecialchars($list_title, ENT_COMPAT, 'UTF-8') . ' ' . Horde::url($refresh_link)->link(array('title' => _("Refresh List"))) . Horde::img('reload.png', _("Refresh List")) . '</a>' ?>
+ <?php echo htmlspecialchars($list_title) . ' ' . Horde::url($refresh_link)->link(array('title' => _("Refresh List"))) . Horde::img('reload.png', _("Refresh List")) . '</a>' ?>
</div>
<table width="100%" style="background:<?php echo $styleDef->background ?>;"><tr>
if ($total) {
echo '<span class="rightFloat">' . ($total > $this->_perPage ? sprintf(_("%d to %d of %d Items"), $this->_pagestart, $this->_pageend, $total) : sprintf(ngettext("%d Item", "%d Items", $total), $total)) . '<small>' . $allLink . '</small></span>';
}
-echo htmlspecialchars($this->getTitle(), ENT_COMPAT, 'UTF-8') . $this->_search->getTagTrail();
+echo htmlspecialchars($this->getTitle()) . $this->_search->getTagTrail();
?>
</div>
<?php echo _("New Gallery Description") ?>
</td>
<td align="left">
- <textarea name="gallery_desc" cols="33" rows="5"><?php echo htmlspecialchars($gallery_desc, ENT_COMPAT, 'UTF-8') ?></textarea>
+ <textarea name="gallery_desc" cols="33" rows="5"><?php echo htmlspecialchars($gallery_desc) ?></textarea>
</td>
</tr>
</table>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
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();
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
}
}
-echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, 'UTF-8');
+echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON);
}
}
- $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 .').'
/* 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;
}
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
-<?php echo '<?xml version="1.0" encoding="' . 'UTF-8' . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
-<?php echo '<?xml version="1.0" encoding="' . 'UTF-8' . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
protected $_mail;
/**
- * The message charset.
- *
- * @var string
- */
- protected $_charset;
-
- /**
* Constructor.
*
* @param array $params Any parameters that the handler might need.
* - 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.');
}
}
$this->_identity = $params['identity'];
$this->_mail = $params['mail'];
- $this->_charset = $params['charset'];
}
/**
'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;
class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase
{
+ protected static $skip = false;
protected static $pearConf;
protected static $db;
protected static $migrator;
require $config;
}
if (!isset($conf['alarm']['test'])) {
- self::markTestSkipped('No configuration for Horde_Alarm test.');
+ self::$skip = true;
return;
}
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()
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;
*/
static public function sendHTTPResponse($data, $ct)
{
- $charset = 'UTF-8';
-
// Output headers and encoded response.
switch ($ct) {
case 'json':
*
* 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;
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;
* @param mixed $data The data to JSON-ify.
* @param array $options Additional options:
* <pre>
- * '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
*/
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 . '*/';
}
}
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);
}
$attributes = array())
{
if (!empty($title)) {
- $charset = 'UTF-8';
- $old_error = error_reporting(0);
- $title = '<pre>' . preg_replace(array('/\n/', '/((?<!<br)\s{1,}(?<!\/>))/em', '/<br \/><br \/>/', '/<br \/>/'), 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/', '/((?<!<br)\s{1,}(?<!\/>))/em', '/<br \/><br \/>/', '/<br \/>/'), array('', 'str_repeat(" ", strlen("$1"))', '<br /> <br />', '<br />'), nl2br(htmlspecialchars(htmlspecialchars($title)))) . '</pre>';
error_reporting($old_error);
self::addScriptFile('tooltips.js', 'horde');
*/
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. */
$img = '<img';
$old_error = error_reporting(0);
foreach ($attributes as $attribute => $value) {
- $img .= ' ' . $attribute . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
+ $img .= ' ' . $attribute . '="' . htmlspecialchars($value) . '"';
}
error_reporting($old_error);
*/
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. */
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. */
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 . '(<span class="accessKey">'
+ return $stripped_label . "\xe2\x80\xad" . '(<span class="accessKey">'
. strtoupper($accessKey) . '</span>' . ')';
}
*/
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;
}
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');
}
'body' => $message,
'to' => $conf['signup']['email'],
'from' => $conf['signup']['email'],
- 'subject' => 'UTF-8'));
+ 'charset' => 'UTF-8'));
$mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
}
}
$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));
global $registry;
$params = array_merge(array(
- 'charset' => 'UTF-8',
'email_charset' => $registry->getEmailCharset(),
'temp' => Horde::getTempDir()
), $params);
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);
}
$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'));
// Fall-through
default:
- $val2 = Horde_String::convertCharset($val, 'UTF-8', 'UTF-8');
+ $val2 = $val;
}
// [0] = pref name
}
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 '<div id="' . $this->_instance . '"></div>';
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
public function __construct($params = array())
{
$this->_params = $params;
- $this->_charset = 'UTF-8';
}
/**
* @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);
- }
}
/**
*
* @param array $params Configuration parameters:
* <pre>
- * 'charset' - (string) The default charset.
- * DEFAULT: NONE
* 'email_charset' - (string) The default email charset.
* DEFAULT: NONE
* 'temp' - (string) [REQUIRED] Location of temporary directory.
$this->_tempdir = Horde_Util::createTempDir(true, $params['temp']);
$this->_params = array_merge(array(
- 'charset' => null,
'email_charset' => null,
), $params);
}
'--armor',
'--always-trust',
'--batch',
- '--charset ' . $this->_params['charset'],
+ '--charset UTF-8',
$keyring,
'--verify'
);
$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
$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();
$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;
}
$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;
$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');
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') &&
/* 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]))
$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;
}
{
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');
}
}
}
- echo '<input type="hidden" name="_formvars" value="' . @htmlspecialchars(serialize($vars), ENT_QUOTES, 'UTF-8') . '" />';
+ echo '<input type="hidden" name="_formvars" value="' . htmlspecialchars(serialize($vars)) . '" />';
}
function renderFormActive(&$form, &$vars)
}
$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;
*/
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)');
}
$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];
*
* @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];
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);
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);
$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.
$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;
}
END:VEVENT
END:VCALENDAR';
-$ical->parseVCalendar($data, 'VCALENDAR', 'UTF-8');
+$ical->parseVCalendar($data, 'VCALENDAR');
$event = $ical->getComponent(0);
var_dump($event->getAttribute('SUMMARY'));
$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);
return $default;
}
- return Horde_String::convertCharset($element->get_content(), 'utf-8');
+ return $element->get_content();
}
function getVal($name, $default = 0)
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 = '')
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']);
}
*/
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
*/
protected function _getNodeContent($node)
{
- return Horde_String::convertCharset($node->textContent, 'utf-8');
+ return $node->textContent;
}
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();
$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');
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
*/
public function __construct()
{
- $this->_charset = 'UTF-8';
if (empty($this->_primaryPersonalNamespace)) {
$personal = null;
foreach ($this->_namespaces as $namespace) {
*/
public function getCharset()
{
- return $this->_charset;
+ throw new Exception('This method is deprecated, assume UTF-8');
}
/**
*/
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);
}
*/
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);
}
*/
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);
}
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()
$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');
{
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,',
{
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']);
* @param string $personal Personal name phrase.
* @param array $opts Additional options:
* <pre>
- * '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
* </pre>
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;
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');
$language = $this->_mimeTypeToLanguage($mimeType);
$brush = $this->_languageToBrush($language);
- $results = '<pre class="brush: ' . $language . '">' . htmlspecialchars($this->_mimepart->getContents(), ENT_QUOTES, $this->getConfigParam('charset')) . '</pre>';
+ 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 = '<pre class="brush: ' . $language . '">' . htmlspecialchars($this->_mimepart->getContents()) . '</pre>';
return $this->_renderReturn(
$results,
- 'text/html; charset=' . $this->getConfigParam('charset')
+ 'text/html; charset=UTF-8'
);
}
}
}
echo '<input type="hidden" name="_formvars" value="'
- . htmlspecialchars(serialize($vars), ENT_QUOTES, 'UTF-8')
+ . htmlspecialchars(serialize($vars))
. '" />';
}
. '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)
return sprintf(
'<input type="text" class="form-input-phone" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
$var->getVarName(),
- htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'),
+ htmlspecialchars($var->getValue($vars)),
($var->isDisabled() ? ' disabled="disabled" ' : ''),
$this->_getActionScripts($form, $var)
);
{
return sprintf(' <input type="text" class="form-input-ipaddress" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
$var->getVarName(),
- htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'),
+ htmlspecialchars($var->getValue($vars)),
$var->isDisabled() ? ' disabled="disabled" ' : '',
$this->_getActionScripts($form, $var)
);
$prompt = $var->type->prompt;
$htmlchars = $var->getOption('htmlchars');
if ($prompt) {
- $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt, ENT_QUOTES, 'UTF-8') : $prompt) . '</option>';
+ $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt) : $prompt) . '</option>';
}
return sprintf(' <select name="%1$s" id="%1$s"%2$s>%3$s%4$s </select>',
$var->getVarName(),
/* Hidden tag to store the current first level. */
$html = sprintf(' <input type="hidden" name="%1$s[old]" id="%1$s[old]" value="%2$s" />',
$varname,
- htmlspecialchars($selected['1'], ENT_QUOTES, 'UTF-8'));
+ htmlspecialchars($selected['1']));
/* First level. */
$values_1 = Horde_Array::valuesToKeys(array_keys($values));
'if (this.value) { document.' . $form->getName() . '.formname.value=\'\';' . 'document.' . $form->getName() . '.submit() }',
($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
if (!empty($prompts)) {
- $html .= '<option value="">' . htmlspecialchars($prompts[0], ENT_QUOTES, 'UTF-8') . '</option>';
+ $html .= '<option value="">' . htmlspecialchars($prompts[0]) . '</option>';
}
$html .= $this->_selectOptions($values_1, $selected['1']);
$html .= ' </select>';
$varname,
($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
if (!empty($prompts)) {
- $html .= '<option value="">' . htmlspecialchars($prompts[1], ENT_QUOTES, 'UTF-8') . '</option>';
+ $html .= '<option value="">' . htmlspecialchars($prompts[1]) . '</option>';
}
$values_2 = array();
if (!empty($selected['1'])) {
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)
return Horde::link($mail_link, $email_val)
. htmlspecialchars($display_email) . '</a>';
} else {
- return nl2br(htmlspecialchars($display_email, ENT_QUOTES, 'UTF-8'));
+ return nl2br(htmlspecialchars($display_email));
}
}
if (count($values) == 0) {
return _("No values");
} elseif (isset($values[$value]) && $value != '') {
- return htmlspecialchars($values[$value], ENT_QUOTES, 'UTF-8');
+ return htmlspecialchars($values[$value]);
}
}
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)]);
}
}
$display[] = $name;
}
}
- return htmlspecialchars(implode(', ', $display), ENT_QUOTES, 'UTF-8');
+ return htmlspecialchars(implode(', ', $display));
}
}
$display[] = $name;
}
}
- return htmlspecialchars(implode(', ', $display), ENT_QUOTES, 'UTF-8');
+ return htmlspecialchars(implode(', ', $display));
}
}
}
}
- $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) . '</a>';
}
function _renderVarDisplay_invalid($form, $var, $vars)
{
return '<p class="form-error form-inline">'
- . htmlspecialchars($var->type->message, ENT_QUOTES, 'UTF-8')
+ . htmlspecialchars($var->type->message)
. '</p>';
}
$selected = '';
}
$result .= ' <option value="';
- $result .= ($htmlchars) ? htmlspecialchars($value, ENT_QUOTES, 'UTF-8') : $value;
+ $result .= ($htmlchars) ? htmlspecialchars($value) : $value;
$result .= '"' . $selected . '>';
$result .= ($htmlchars) ? htmlspecialchars($display) : $display;
$result .= "</option>\n";
$selected = '';
}
$result .= " <option value=\""
- . htmlspecialchars($value, ENT_QUOTES, 'UTF-8')
+ . htmlspecialchars($value)
. "\"$selected>" . htmlspecialchars($display) . "</option>\n";
}
// 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']);
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
// 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:'])) {
default:
$propstats[$i]['D:prop']['D:'. $prop['name']] = $prop['val'];
#echo " <D:$prop[name]>"
- # . $this->_prop_encode(htmlspecialchars($prop['val']))
+ # . htmlspecialchars($prop['val'])
# . "</D:$prop[name]>\n";
break;
}
if ($responsedescr) {
echo " <D:responsedescription>".
- $this->_prop_encode(htmlspecialchars($responsedescr)).
+ htmlspecialchars($responsedescr).
"</D:responsedescription>\n";
}
}
/**
- * 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
$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+.
protected $_locale = 'en';
/**
- * @var string
- */
- protected $_encoding = 'utf-8';
-
- /**
* @var boolean
*/
protected $_html = false;
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]);
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);
*/
protected function _cmd()
{
- $args = '';
+ $args = '--encoding=UTF-8';
switch ($this->_suggestMode) {
case self::SUGGEST_FAST:
$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;
}
}
*/
protected $_params = array(
'body_only' => false,
- 'charset' => 'us-ascii',
'size' => false
);
'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);
}
}
*/
protected $_params = array(
'callback' => null,
- 'charset' => 'UTF-8',
'width' => 75
);
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("/\<br\s*\/?\>/i", "\n", $text));
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 {
* @var array
*/
protected $_params = array(
- 'charset' => 'ISO-8859-1',
'encode' => false,
'encode_all' => false
);
public function preProcess($text)
{
if ($this->_params['encode']) {
- $text = @htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']);
+ $text = htmlspecialchars($text);
}
return $text;
}
* @var array
*/
protected $_params = array(
- 'charset' => 'ISO-8859-1',
'class' => 'fixed',
'emails' => false,
'linkurls' => false,
);
/**
- * 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.
}
if ($this->_params['parselevel'] == self::NOHTML_NOBREAK) {
- return @htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']);
+ return htmlspecialchars($text);
}
if ($this->_params['parselevel'] < self::NOHTML) {
/* 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);
* Filter parameters:
* ------------------
* <pre>
- * '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
* @var array
*/
protected $_params = array(
- 'charset' => 'UTF-8',
'noprefetch' => false,
'return_document' => false,
'return_dom' => false,
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;
}
}
}
- return Horde_String::convertCharset($text, $dom->encoding, $this->_params['charset']);
+ return Horde_String::convertCharset($text, $dom->encoding, 'UTF-8');
}
/**
[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);
}
* @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
* @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)) {
$wrapped .= $line;
}
- return self::convertCharset($wrapped . $string, 'utf-8', $charset);
+ return $wrapped . $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
* @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();
if ($input != '-- ') {
$input = rtrim($input);
}
- $line = self::wordwrap($input, $length, $break_char, false, $charset);
+ $line = self::wordwrap($input, $length, $break_char);
}
$paragraphs[] = $line;
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(
<<<EOT
Lörem ipsüm dölör sit ämet,
mäüris ämet.
EOT
,
- Horde_String::wordwrap($string, 30, "\n ", false, 'utf-8'));
+ Horde_String::wordwrap($string, 30, "\n "));
// Test existing line breaks.
$string = "Lörem ipsüm dölör sit ämet, cönsectetüer ädipiscing elit.\nAliqüäm söllicitüdin fäücibüs mäüris ämet.";
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));
$string = "Lörem ipsüm dölör sit ämet, cönsectetüer ädipiscing elit. Aliqüäm\nsöllicitüdin fäücibüs mäüris ämet.";
$this->assertEquals(
<<<EOT
söllicitüdin fäücibüs mäüris ämet.
EOT
,
- Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+ Horde_String::wordwrap($string));
$string = "Lörem ipsüm dölör sit ämet, cönsectetüer ädipiscing elit. Aliqüäm söllicitüdin\nfäücibüs mäüris ämet.";
$this->assertEquals(
<<<EOT
fäücibüs mäüris ämet.
EOT
,
- Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+ Horde_String::wordwrap($string));
// Test overlong words and word cut.
$string = "Löremipsümdölörsitämet, cönsectetüerädipiscingelit.";
cönsectetüerädipiscingelit.
EOT
,
- Horde_String::wordwrap($string, 15, "\n", false, 'utf-8'));
+ Horde_String::wordwrap($string, 15));
$string = "Löremipsümdölörsitämet, cönsectetüerädipiscingelit.";
$this->assertEquals(
<<<EOT
piscingelit.
EOT
,
- Horde_String::wordwrap($string, 15, "\n", true, 'utf-8'));
+ Horde_String::wordwrap($string, 15, "\n", true));
// Test whitespace at wrap width.
$string = "Lörem ipsüm dölör sit ämet, cönsectetüer ädipiscing";
cönsectetüer ädipiscing
EOT
,
- Horde_String::wordwrap($string, 27, "\n", false, 'utf-8'));
+ Horde_String::wordwrap($string, 27));
$this->assertEquals(
<<<EOT
Lörem ipsüm dölör sit ämet,
cönsectetüer ädipiscing
EOT
,
- Horde_String::wordwrap($string, 28, "\n", false, 'utf-8'));
+ Horde_String::wordwrap($string, 28));
// Test line folding.
$string = "Löremipsümdölörsitämet, cönsectetüerädipiscingelit.";
$value = $this->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')
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
-$charset = 'UTF-8';
-
/* Variables used in core javascript files. */
$var = array(
'URI_AJAX' => Horde::getServiceLink('ajax', 'gollem')->url,
?>
<script type="text/javascript">//<![CDATA[
-var GollemVar = <?php echo Horde_Serialize::encode($var, Horde_Serialize::SERIALIZE_JSON, $charset) ?>;
-var GollemText = <?php echo Horde_Serialize::encode($gettext, Horde_Serialize::SERIALIZE_JSON, $charset) ?>;
+var GollemVar = <?php echo Horde_Serialize::encode($var, Horde_Serialize::SERIALIZE_JSON) ?>;
+var GollemText = <?php echo Horde_Serialize::encode($gettext, Horde_Serialize::SERIALIZE_JSON) ?>;
//]]></script>
}
$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);
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
}
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();
$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";
// $ldapServer = 'ldap.example.com';
// $ldapPort = '389';
// $searchBase = 'ou=people,o=example.com';
-// $ldapcharset = 'utf-8';
-// $outputcharset = 'UTF-8';
//
// $ds = @ldap_connect($ldapServer, $ldapPort);
//
//
// ldap_close($ds);
//
-// $name = Horde_String::convertCharset($name, $ldapcharset, $outputcharset);
// return empty($name) ? $user : $name;
// }
'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',
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.
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
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 = '<div style="padding: 0 8px 8px">'
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');
}
// 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])) {
$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'));
/* 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;
<label for="new_user" class="hidden"><?php echo _("User") ?></label>
<input type="text" id="new_user" name="new_user" />
<?php endif; ?>
-<input type="submit" class="button" value="<?php echo htmlspecialchars(sprintf(_("Save \"%s\""), $group->getShortName()), ENT_COMPAT, 'UTF-8') ?>" />
+<input type="submit" class="button" value="<?php echo htmlspecialchars(sprintf(_("Save \"%s\""), $group->getShortName())) ?>" />
</p>
<br />
<?php
if (isset($GLOBALS['language'])) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
$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());
}
if (isset($GLOBALS['language'])) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
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;
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;
/* 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;
$descrip .= "\n[stop]";
}
- $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . '</a>';
+ $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . htmlspecialchars($name) . '</a>';
} else {
- $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . '</a>';
+ $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . htmlspecialchars($name) . '</a>';
}
/* Create edit link. */
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)
));
}
}
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');;
. _("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) {
}
/**
- * 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.
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()));
}
}
- $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);
$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();
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)));
}
$vals = array(
- 'subject' => $this->encode($vacation->getVacationSubject()),
+ 'subject' => $vacation->getVacationSubject(),
'days' => $vacation->getVacationDays(),
'addresses' => $vacation_addr,
'start' => $vacation->getVacationStart(),
'end_year' => $vacation->getVacationEndYear(),
'end_month' => $vacation->getVacationEndMonth(),
'end_day' => $vacation->getVacationEndDay(),
- 'reason' => $this->encode($vacation->getVacationReason()),
+ 'reason' => $vacation->getVacationReason(),
);
$action = $tests = array();
$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);
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())));
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();
$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(),
$GLOBALS['ingo_script'] = Ingo_Script::factory(
'maildrop',
array('path_style' => 'mbox',
- 'charset' => 'UTF-8',
'spam_compare' => 'string',
'spam_header' => 'X-Spam-Level',
'spam_char' => '*'));
$GLOBALS['ingo_script'] = Ingo_Script::factory(
'procmail',
array('path_style' => 'mbox',
- 'charset' => 'UTF-8',
'spam_compare' => 'string',
'spam_header' => 'X-Spam-Level',
'spam_char' => '*'));
$GLOBALS['notification'] = new Ingo_Test_Notification;
$params = array('api' => $this->api,
- 'charset' => 'UTF-8',
'spam_compare' => 'string',
'spam_header' => 'X-Spam-Level',
'spam_char' => '*');
{
$params = array('date_format' => '%x',
'time_format' => '%R',
- 'charset' => 'UTF-8',
'spam_compare' => 'string',
'spam_header' => 'X-Spam-Level',
'spam_char' => '*');
'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',
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();
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));
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
$page_title = $GLOBALS['registry']->get('name');
<table width="100%" cellspacing="0">
<tr class="control">
<td>
- <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, 'UTF-8') : '' ?>" />
+ <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? htmlspecialchars($rule['name']) : '' ?>" />
</td>
<td width="40" class="rightAlign">
<?php echo Horde_Help::link('ingo', 'rule-name') ?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
// 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') {
try {
$story = $this->_fetch();
} catch (Exception $e) {
- return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8');
+ return htmlspecialchars($e->getMessage());
}
return '<span class="storyDate">'
- . @htmlspecialchars($story['updated_date'], ENT_COMPAT, 'UTF-8')
+ . htmlspecialchars($story['updated_date'])
. '</span> '
- . @htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8');
+ . htmlspecialchars($story['title']);
}
/**
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'])
. '</a>';
} else {
- $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8');
+ $title = htmlspecialchars($channel['channel_name']);
}
return $title;
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") . '</a>';
} else {
- $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8')
+ $title = htmlspecialchars($channel['channel_name'])
. _(" - Most read stories");
}
try {
$story = $this->_fetch();
} catch (Jonah_Exception $e) {
- return htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8');
+ return htmlspecialchars($e->getMessage());
}
return '<span class="storyDate">'
- . htmlspecialchars($story['updated_date'], ENT_COMPAT,'UTF-8')
+ . htmlspecialchars($story['updated_date'])
. '</span> '
- . htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8');
+ . htmlspecialchars($story['title']);
}
/**
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
$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';
-/*
- Local variables:
- buffer-file-coding-system: utf-8
- End:
-*/
body {
color: black;
background-color: #F8FCF8;
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;
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');
$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;
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;
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();
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;
$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');
}
$modified = new Horde_Date($modified);
/* Description. */
- $desc = @htmlspecialchars($event->description, ENT_COMPAT, 'UTF-8');
+ $desc = htmlspecialchars($event->description);
if (strlen($desc)) {
$desc .= '<br /><br />';
}
$attendees[] = empty($status['name']) ? $attendee : Horde_Mime_Address::trimAddress($status['name'] . (strpos($attendee, '@') === false ? '' : ' <' . $attendee . '>'));
}
if (count($attendees)) {
- $desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, 'UTF-8');
+ $desc .= '<br />' . _("Who:") . ' ' . htmlspecialchars(implode(', ', $attendees));
}
if (strlen($event->location)) {
- $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->location, ENT_COMPAT, 'UTF-8');
+ $desc .= '<br />' . _("Where:") . ' ' . htmlspecialchars($event->location);
}
$desc .= '<br />' . _("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);
}
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;
$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));
$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) {
$tree->addNode(
$parent . $calId . $event->id,
$parent,
- htmlspecialchars($event->getTitle(), ENT_COMPAT, 'UTF-8'),
+ htmlspecialchars($event->getTitle()),
1,
false,
array(
$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
$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']));
}
} 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;
*/
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;
}
$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;
$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 */
*/
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,
$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 */
}
/* 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 :
/* Tags/Categories */
foreach ($exception->tags as $tag) {
- $e->addCategory(Horde_String::convertCharset($tag, $charset, 'utf-8'));
+ $e->addCategory($tag);
}
$message->addexception($e);
$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'];
/* Categories (tags) */
foreach ($this->tags as $tag) {
- $message->addCategory(Horde_String::convertCharset($tag, $charset, 'utf-8'));
+ $message->addCategory($tag);
}
return $message;
// 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."));
'',
array('style' => $this->getCSSColors(false)));
}
- $link .= @htmlspecialchars($event_title, ENT_QUOTES, 'UTF-8');
+ $link .= htmlspecialchars($event_title);
if ($read_permission && $view_url) {
$link .= '</a>';
}
{
$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++;
$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();
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');
}
// 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) . ';');
}
/**
/* 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
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) {
}
}
$GLOBALS['browser']->downloadHeaders(
$event->getTitle() . '.ics',
- 'text/calendar; charset=' . 'UTF-8',
+ 'text/calendar; charset=UTF-8',
true, strlen($content));
echo $content;
exit;
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();
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');
}
?>
* JavaScript variables for the traditional interface.
*/
-$charset = 'UTF-8';
$currentDate = Kronolith::currentDate();
/* Variables used in core javascript files. */
?>
<script type="text/javascript">//<![CDATA[
var KronolithDate = new Date(<?php printf('%d, %d, %d', $currentDate->year, $currentDate->month - 1, $currentDate->mday) ?>);
-var KronolithText = <?php echo Horde_Serialize::serialize($gettext, Horde_Serialize::JSON, $charset) ?>;
-var KronolithVar = <?php echo Horde_Serialize::serialize($var, Horde_Serialize::JSON, $charset) ?>;
+var KronolithText = <?php echo Horde_Serialize::serialize($gettext, Horde_Serialize::JSON) ?>;
+var KronolithVar = <?php echo Horde_Serialize::serialize($var, Horde_Serialize::JSON) ?>;
var KronolithView = '<?php if (isset($view) && is_object($view)) echo $view->getName() ?>';
//]]></script>
<!-- owner -->
<tr>
<td class="rightAlign"><strong><?php echo _("Owner") ?> </strong></td>
- <td><?php echo @htmlspecialchars($owner, ENT_COMPAT, 'UTF-8') ?> </td>
+ <td><?php echo htmlspecialchars($owner) ?> </td>
</tr>
<?php endif; ?>
<?php if (isset($created)): ?>
<tr>
<td class="nowrap rightAlign"><strong><?php echo _("Created") ?></strong> </td>
- <td class="nowrap"><?php echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, 'UTF-8') ?></td>
+ <td class="nowrap"><?php echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . htmlspecialchars($createdby) ?></td>
</tr>
<?php endif; ?>
<?php if (isset($modified)): ?>
<tr>
<td class="nowrap rightAlign"><strong><?php echo _("Last Modified") ?></strong> </td>
- <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, 'UTF-8') ?></td>
+ <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . htmlspecialchars($modifiedby) ?></td>
</tr>
<?php endif; ?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
);
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);
}
$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);
}
/* 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);
}
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
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');
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;
$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()) {
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);
return Horde::link($GLOBALS['registry']->call(
'mail/compose',
array(array('to' => $email))))
- . @htmlspecialchars($fullname . ' <' . $email . '>',
- ENT_COMPAT, 'UTF-8')
+ . htmlspecialchars($fullname . ' <' . $email . '>')
. '</a>';
}
- return @htmlspecialchars($fullname, ENT_COMPAT, 'UTF-8');
+ return htmlspecialchars($fullname);
}
/**
}
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)) {
}
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. */
$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) {
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()) {
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();
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php if (isset($created)): ?>
<tr>
<td class="rightAlign"><strong><?php echo _("Created") ?></strong></td>
- <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, 'UTF-8') ?></td>
+ <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . htmlspecialchars($createdby) ?></td>
</tr>
<?php endif; ?>
<?php if (isset($modified)): ?>
<tr>
<td class="rightAlign"><strong><?php echo _("Last Modified") ?></strong></td>
- <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, 'UTF-8') ?></td>
+ <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . htmlspecialchars($modifiedby) ?></td>
</tr>
<?php endif; ?>
$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();
$list = News::getLastComments(50);
$title = _("Last comments");
- $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($title) . '</title>
$cache->set($cache_key, $rss);
}
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
echo $rss;
$title = $registry->get('name', 'horde');
$read_url = Horde::url('read.php', true, -1);
- $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($title) . '</title>
}
// Wee need the last published news time
- $rssheader = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rssheader = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
var ajax_url = '<?php echo Horde::getServiceLink('ajax', 'shout') ?>';
var curmenu = null;
var menuInfo = $H();
-var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON, 'UTF-8'); ?>);
-var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON, 'UTF-8'); ?>);
-var conferences = $H(<?php echo Horde_Serialize::serialize($conferences, Horde_Serialize::JSON, 'UTF-8'); ?>);
-var recordings = $H(<?php echo Horde_Serialize::serialize($recordings, Horde_Serialize::JSON, 'UTF-8'); ?>);
+var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON); ?>);
+var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON); ?>);
+var conferences = $H(<?php echo Horde_Serialize::serialize($conferences, Horde_Serialize::JSON); ?>);
+var recordings = $H(<?php echo Horde_Serialize::serialize($recordings, Horde_Serialize::JSON); ?>);
function empty(p)
{
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
/* 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);
}
/* 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);
}
$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);
}
$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);
}
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);
}
$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);
}
$cache_key = 'trean_rss_' . Horde_Auth::getAuth() . '_' . ($folderId === null ? 'all' : $folderId);
$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
if (!$rss) {
- $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+ $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($folderId == null ? $registry->get('name') : $folder->get('name')) . '</title>
<language>' . $registry->preferredLang() . '</language>
- <charset>' . 'UTF-8' . '</charset>
+ <charset>UTF-8</charset>
<lastBuildDate>' . date('Y-m-d H:i:s') . '</lastBuildDate>
<image>
<url>http://' . $_SERVER['SERVER_NAME'] . $registry->get('webroot') . '/themes/graphics/favicon.ico</url>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
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
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;
continue;
}
- if ($version != '2.1') {
- $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
- }
-
switch ($key) {
case 'name':
if ($fields && !isset($fields['FN'])) {
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);
}
} 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());
}
}
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);
}
}
} 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);
}
}
} 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);
}
}
} 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);
}
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':
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 */
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;
}
if (empty($this->fileas)) {
- $message->fileas = Horde_String::convertCharset(Turba::formatName($object), $charset, 'utf-8');
+ $message->fileas = Turba::formatName($object);
}
return $message;
public function fromASContact($message)
{
$hash = array();
- $charset = 'UTF-8';
$formattedname = false;
$textMap = array(
);
foreach ($textMap as $asField => $turbaField) {
if (!$message->isGhosted($asField)) {
- $hash[$turbaField] = Horde_String::convertCharset($message->{$asField}, 'utf-8', $charset);
+ $hash[$turbaField] = $message->{$asField};
}
}
/* 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'] = '';
}
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')) {
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')) {
$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');
}
}
. ' '
. date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:i a', $entry['ts'])
. ' '
- . @htmlspecialchars($by, ENT_COMPAT, 'UTF-8');
+ . htmlspecialchars($by);
}
}
} catch (Exception $e) {
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;
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;
<?php
global $language;
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
$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)));
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
$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(
' (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');
$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');
$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');
$message_file .= '.txt';
/* Prepare message text. */
- $message = Horde_String::convertCharset(file_get_contents($message_file),
- 'UTF-8');
$message = str_replace(
array('@@ticket_url@@',
'@@table@@',
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. */
$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 <<<PAYLOAD
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>$name</ShortName>
}
$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")));
}
$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'])) {
}
$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"));
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
}
$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']));
}
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
$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'];
$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 <<<PAYLOAD
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>$name</ShortName>
<Param name="params" value="{searchTerms}"/>
</Url>
<Image height="16" width="16">data:image/png;base64,$icon</Image>
- <InputEncoding>$charset</InputEncoding>
+ <InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
PAYLOAD;
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . 'UTF-8');
+ header('Content-type: text/html; charset=UTF-8');
header('Vary: Accept-Language');
}
?>
</div>
<div style="padding:8px">
- <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, 'UTF-8') ?></textarea>
+ <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo htmlspecialchars($page_text) ?></textarea>
</div>
</form>
<?php endif; endif; ?>
<div style="padding:8px">
- <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, 'UTF-8') ?></textarea>
+ <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo htmlspecialchars($page_text) ?></textarea>
</div>
</form>
<td style="text-align:center"><input type="submit" class="button" value="<?php echo htmlspecialchars($page->version()) ?>" onclick="if (document.diff.v1[<?php echo $i ?>].checked) return false; document.diff.v2.value = '<?php echo htmlspecialchars($pversion) ?>';" /></td>
<?php endif; ?>
- <td><?php echo @htmlspecialchars($page->changeLog(), ENT_COMPAT, 'UTF-8') ?></td>
+ <td><?php echo htmlspecialchars($page->changeLog()) ?></td>
</tr>