Strip tags and convert < > to entities when appending widget title, fixes #9830

git-svn-id: https://develop.svn.wordpress.org/trunk@11349 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-05-16 00:32:04 +00:00
parent d600eaf1c7
commit 8644a0c9d7
3 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -158,8 +158,10 @@ wpWidgets = {
appendTitle : function(widget) {
$('input[type="text"]', widget).each(function(){
if ( this.id.indexOf('title') != -1 && $(this).val() ) {
$('.widget-title .in-widget-title', widget).html(': ' + $(this).val());
var title;
if ( this.id.indexOf('title') != -1 ) {
title = $(this).val().replace(/<[^<>]+>/g, '').replace(/</g, '&lt;').replace(/>/g, '&gt;');
$('.widget-title .in-widget-title', widget).html(': ' + title);
return false;
}
});