Bug 26592: [19.05] Prevent XSS vulnerabilities when circ/ysearch.pl is used
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
parent
efd6054050
commit
858ca2ac2b
|
|
@ -98,11 +98,11 @@
|
|||
var cardnumber = "";
|
||||
if( item.cardnumber != "" ){
|
||||
// Display card number in parentheses if it exists
|
||||
cardnumber = " (" + item.cardnumber + ") ";
|
||||
cardnumber = " (" + ( item.cardnumber ? item.surname.escapeHtml() : "" ) + ") ";
|
||||
}
|
||||
return $( "<li></li>" )
|
||||
.data( "ui-autocomplete-item", item )
|
||||
.append( "<a href=\"" + item.link + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
|
||||
.append( "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml : "" ) + ( cardnumber ? cardnumber.escapeHtml() : "" ) + " <small>" + ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) + " " + ( item.address ? item.address.escapeHtml() : "" ) + " " + ( item.city ? item.city.escapeHtml() : "" ) + " " + ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " " + ( item.country ? item.country.escapeHtml() : "" ) + "</small></a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -323,10 +323,23 @@
|
|||
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "ui-autocomplete-item", item )
|
||||
.append( "<a>" + item.surname + ", " + item.firstname +
|
||||
" (" + item.cardnumber + ") <small>" + item.address +
|
||||
" " + item.city + " " + item.zipcode + " " +
|
||||
item.country + "</small></a>" )
|
||||
.append(
|
||||
"<a>"
|
||||
+ ( item.surname ? item.surname.escapeHtml() : "" )
|
||||
+ ", "
|
||||
+ ( item.firstname ? item.firstname.escapeHtml() : "" )
|
||||
+ " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
|
||||
+ " "
|
||||
+ "<small>"
|
||||
+ ( item.address ? item.address.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.city ? item.city.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.country ? item.country.escapeHtml() : "" )
|
||||
+ "</small>"
|
||||
+ "</a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,7 +169,23 @@
|
|||
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "ui-autocomplete-item", item )
|
||||
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
|
||||
.append(
|
||||
"<a>"
|
||||
+ ( item.surname ? item.surname.escapeHtml() : "" )
|
||||
+ ", "
|
||||
+ ( item.firstname ? item.firstname.escapeHtml() : "" )
|
||||
+ " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
|
||||
+ " "
|
||||
+ "<small>"
|
||||
+ ( item.address ? item.address.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.city ? item.city.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.country ? item.country.escapeHtml() : "" )
|
||||
+ "</small>"
|
||||
+ "</a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
|
||||
|
|
@ -186,7 +202,7 @@
|
|||
});
|
||||
|
||||
function AddInstructor( name, borrowernumber ) {
|
||||
div = "<div class='instructor_line' id='borrower_" + borrowernumber + "'>" + name + " ( <a href='#' class='removeInstructor'><i class='fa fa-trash'></i> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + borrowernumber + "' /></div>";
|
||||
div = "<div class='instructor_line' id='borrower_" + borrowernumber + "'>" + ( name ? name.escapeHtml() : "" ) + " ( <a href='#' class='removeInstructor'><i class='fa fa-trash'></i> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + borrowernumber + "' /></div>";
|
||||
$('#instructors').append( div );
|
||||
|
||||
$('#find_instructor').val('').focus();
|
||||
|
|
|
|||
|
|
@ -902,10 +902,23 @@
|
|||
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "ui-autocomplete-item", item )
|
||||
.append( "<a>" + item.surname + ", " + item.firstname +
|
||||
" (" + item.cardnumber + ") <small>" + item.address +
|
||||
" " + item.city + " " + item.zipcode + " " +
|
||||
item.country + "</small></a>" )
|
||||
.append(
|
||||
"<a>"
|
||||
+ ( item.surname ? item.surname.escapeHtml() : "" )
|
||||
+ ", "
|
||||
+ ( item.firstname ? item.firstname.escapeHtml() : "" )
|
||||
+ " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
|
||||
+ " "
|
||||
+ "<small>"
|
||||
+ ( item.address ? item.address.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.city ? item.city.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" )
|
||||
+ " "
|
||||
+ ( item.country ? item.country.escapeHtml() : "" )
|
||||
+ "</small>"
|
||||
+ "</a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
[% END %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue