Index: kernel/db/cat_event_handler.php =================================================================== --- kernel/db/cat_event_handler.php (revision 15226) +++ kernel/db/cat_event_handler.php (working copy) @@ -1090,7 +1090,7 @@ $event->redirect = false; $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; - $keywords = kUtil::unhtmlentities( trim($this->Application->GetVar('keywords')) ); + $keywords = htmlspecialchars_decode( trim($this->Application->GetVar('keywords')) ); $query_object = $this->Application->recallObject('HTTPQuery'); /* @var $query_object kHTTPQuery */ @@ -1634,14 +1634,14 @@ $condition = ''; switch ($record['FieldType']) { case 'select': - $keywords[$field] = kUtil::unhtmlentities( $keywords[$field] ); + $keywords[$field] = htmlspecialchars_decode( $keywords[$field] ); if ($keywords[$field]) { $condition = sprintf($condition_patterns['is'], $field_name, $this->Conn->qstr( $keywords[$field] )); } break; case 'multiselect': - $keywords[$field] = kUtil::unhtmlentities( $keywords[$field] ); + $keywords[$field] = htmlspecialchars_decode( $keywords[$field] ); if ($keywords[$field]) { $condition = Array (); $values = explode('|', substr($keywords[$field], 1, -1)); @@ -1653,7 +1653,7 @@ break; case 'text': - $keywords[$field] = kUtil::unhtmlentities( $keywords[$field] ); + $keywords[$field] = htmlspecialchars_decode( $keywords[$field] ); if (mb_strlen($keywords[$field]) >= $this->Application->ConfigValue('Search_MinKeyword_Length')) { $highlight_keywords[] = $keywords[$field]; Index: kernel/globals.php =================================================================== --- kernel/globals.php (revision 15246) +++ kernel/globals.php (working copy) @@ -302,21 +302,6 @@ } /** - * Reverts effects of "htmlspecialchars" function - * - * @param string $string - * @return string - * @access public - */ - public static function unhtmlentities($string) - { - $trans_tbl = get_html_translation_table(HTML_ENTITIES); // from PHP 5.3.4: , ENT_COMPAT, 'utf-8'); - $trans_tbl = array_flip ($trans_tbl); - - return strtr($string, $trans_tbl); - } - - /** * submits $url with $post as POST * * @param string $url Index: kernel/processors/main_processor.php =================================================================== --- kernel/processors/main_processor.php (revision 15278) +++ kernel/processors/main_processor.php (working copy) @@ -408,7 +408,7 @@ } if (array_key_exists('no_html_escape', $params) && $params['no_html_escape']) { - return kUtil::unhtmlentities($ret); + return htmlspecialchars_decode($ret); } return $ret; Index: kernel/utility/formatters/formatter.php =================================================================== --- kernel/utility/formatters/formatter.php (revision 15226) +++ kernel/utility/formatters/formatter.php (working copy) @@ -75,7 +75,7 @@ elseif ( $field_type == 'string' ) { if ( !$this->Application->isAdmin && isset($options['allow_html']) && $options['allow_html'] ) { // this allows to revert htmlspecialchars call for each field submitted on front-end - $value = kUtil::unhtmlentities($value); + $value = htmlspecialchars_decode($value); } return $value; Index: units/categories/categories_event_handler.php =================================================================== --- units/categories/categories_event_handler.php (revision 15268) +++ units/categories/categories_event_handler.php (working copy) @@ -2265,7 +2265,7 @@ function OnUpdatePreviewBlock($event) { $event->status = kEvent::erSTOP; - $string = kUtil::unhtmlentities($this->Application->GetVar('preview_content')); + $string = htmlspecialchars_decode($this->Application->GetVar('preview_content')); $category_helper = $this->Application->recallObject('CategoryHelper'); /* @var $category_helper CategoryHelper */ @@ -2286,7 +2286,7 @@ $event->redirect = false; $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; - $keywords = kUtil::unhtmlentities( trim($this->Application->GetVar('keywords')) ); + $keywords = htmlspecialchars_decode( trim($this->Application->GetVar('keywords')) ); $query_object = $this->Application->recallObject('HTTPQuery'); /* @var $query_object kHTTPQuery */ Index: units/categories/categories_tag_processor.php =================================================================== --- units/categories/categories_tag_processor.php (revision 15274) +++ units/categories/categories_tag_processor.php (working copy) @@ -942,7 +942,7 @@ */ protected function SpellingSuggestions($params) { - $keywords = kUtil::unhtmlentities( trim($this->Application->GetVar('keywords')) ); + $keywords = htmlspecialchars_decode( trim($this->Application->GetVar('keywords')) ); if ( !$keywords ) { return ''; } Index: units/forms/form_submissions/form_submissions_eh.php =================================================================== --- units/forms/form_submissions/form_submissions_eh.php (revision 15165) +++ units/forms/form_submissions/form_submissions_eh.php (working copy) @@ -262,7 +262,7 @@ $theme = $this->Application->recallObject('theme.current'); /* @var $theme kDBItem */ - $template = kUtil::unhtmlentities($this->Application->GetVar('success_template')); // kHTTPQuery do htmlspecialchars on everything + $template = htmlspecialchars_decode($this->Application->GetVar('success_template')); // kHTTPQuery do htmlspecialchars on everything $alias_template = $theme->GetField('TemplateAliases', $template); $event->redirect = $alias_template ? $alias_template : $template; Index: units/thesaurus/thesaurus_eh.php =================================================================== --- units/thesaurus/thesaurus_eh.php (revision 15165) +++ units/thesaurus/thesaurus_eh.php (working copy) @@ -32,7 +32,7 @@ /* @var $object kDBList */ if ( !$this->Application->isAdminUser ) { - $keywords = kUtil::unhtmlentities(trim($this->Application->GetVar('keywords'))); + $keywords = htmlspecialchars_decode(trim($this->Application->GetVar('keywords'))); $object->addFilter('search_filter', '%1$s.SearchTerm LIKE ' . $this->Conn->qstr($keywords) . ' OR %1$s.SearchTerm LIKE ' . $this->Conn->qstr($keywords . '_')); } } Index: units/thesaurus/thesaurus_tp.php =================================================================== --- units/thesaurus/thesaurus_tp.php (revision 15165) +++ units/thesaurus/thesaurus_tp.php (working copy) @@ -30,7 +30,7 @@ function _getThesaurusRecords() { - $keywords = kUtil::unhtmlentities( trim($this->Application->GetVar('keywords')) ); + $keywords = htmlspecialchars_decode( trim($this->Application->GetVar('keywords')) ); $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); $sql = 'SELECT * Index: units/user_profile/user_profile_eh.php =================================================================== --- units/user_profile/user_profile_eh.php (revision 15165) +++ units/user_profile/user_profile_eh.php (working copy) @@ -67,7 +67,7 @@ } } else { - $this->Application->StorePersistentVar($variable_name, kUtil::unhtmlentities($variable_value)); + $this->Application->StorePersistentVar($variable_name, htmlspecialchars_decode($variable_value)); } }