Index: core/admin_templates/tree.tpl IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/admin_templates/tree.tpl (revision 15892) +++ core/admin_templates/tree.tpl (revision ) @@ -47,9 +47,9 @@ - debug_only="1"> + debug_only="1"> - img/icons/icon24_.png" load_url="" debug_only="1"> + img/icons/icon24_.png" load_url="" debug_only="1"> @@ -66,11 +66,11 @@ }; - var the_tree = new TreeFolder('tree', '', '', 'img/icons/icon24_.png', null, null, '', ''); + var the_tree = new TreeFolder('tree', '', '', 'img/icons/icon24_.png', null, null, '', ''); - the_tree.AddFromXML(''); + the_tree.AddFromXML(''); var fld = the_tree.locateItemByURL(''); \ No newline at end of file Index: core/kernel/processors/main_processor.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/kernel/processors/main_processor.php (revision 15892) +++ core/kernel/processors/main_processor.php (revision ) @@ -610,7 +610,8 @@ } if ( isset($params['escape']) && $params['escape'] ) { - $translation = kUtil::escape($translation, kUtil::ESCAPE_HTML . '+' . kUtil::ESCAPE_JS); + // html escaping here is redundant + $translation = kUtil::escape($translation, kUtil::ESCAPE_JS); } return $translation; Index: core/admin_templates/js/toolbar.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/admin_templates/js/toolbar.js (revision 15892) +++ core/admin_templates/js/toolbar.js (revision ) @@ -3,10 +3,10 @@ this.Title = title || ''; this.TranslateLink = false; this.CheckTitleModule(); - this.Alt = RemoveTranslationLink(alt || ''); + this.Alt = RemoveTranslationLink(alt || '', false); if (this.Alt != alt) { this.TranslateLink = alt || ''; - this.TranslateLink = this.TranslateLink.replace(/<a href="(.*?)".*>(.*?)<\/a>/g, '$1'); + this.TranslateLink = this.TranslateLink.replace(/(.*?)<\/a>/g, '$1'); } if (this.Alt.match(/(.*)::(.*)/)) { @@ -111,33 +111,28 @@ } ToolBarButton.prototype.EditTitle = function() { - if (this.TranslateLink !== false && !this.ReadOnly) { - var $links = this.TranslateLink; - - $links = $links.split('::'); - var $i = 0; - while ($i < $links.length) { - var $link = $links[$i]; - if ($link.match(/(javascript:|http:\/\/)(.*)/)) { - var $link_type = RegExp.$1; - $link = RegExp.$2.replace(/&#[0]{0,1}39;/g, '"'); - if ($link_type == 'javascript:') { - eval($link); + if ( this.TranslateLink === false || this.ReadOnly ) { + return true; - } + } - else { - window.location.href = 'http://' + $link; - } + var $link = '', + $links = this.TranslateLink.split('::'); + - // edit one phrase at a time + // edit one phrase at a time + for ( var $i = 0; $i < $links.length; $i++ ) { + $link = htmlspecialchars_decode($links[$i]); + + if ( $link.match(/^javascript:(.*)/) ) { + eval(RegExp.$1); - break; - } + break; + } - $i++; + else if ( $link.match(/^http:\/\/(.*)/) ) { + window.location.href = 'http://' + RegExp.$1; + break; } - - return false; } - return true; + return false; } ToolBarButton.prototype.SetOnMouseOver = function() { Index: core/kernel/languages/phrases_cache.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/kernel/languages/phrases_cache.php (revision 15892) +++ core/kernel/languages/phrases_cache.php (revision ) @@ -114,6 +114,7 @@ 'phrases_label' => '#LABEL#', 'phrases_event' => 'OnPreparePhrase', 'next_template' => kUtil::escape('external:' . $_SERVER['REQUEST_URI'], kUtil::ESCAPE_URL), + '__URLENCODE__' => 1, 'pass' => 'm,phrases' ); \ No newline at end of file Index: core/admin_templates/js/script.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/admin_templates/js/script.js (revision 15892) +++ core/admin_templates/js/script.js (revision ) @@ -961,6 +961,15 @@ // $grid.Resize( $grid.GetAutoSize() ); } +function htmlspecialchars_decode(string) { + string = string.toString().replace(/</g, '<').replace(/>/g, '>'); + string = string.replace(/�*39;/g, "'"); + string = string.replace(/"/g, '"'); + string = string.replace(/&/g, '&'); + + return string; +} + function RemoveTranslationLink($string, $escaped) { if ( !isset($escaped) ) $escaped = true; \ No newline at end of file