bug in functions.js: Cannot read property 'replace' of undefined

Signed-off-by: Marc Delisle <marc@infomarc.info>
This commit is contained in:
Marc Delisle 2014-08-30 07:22:14 -04:00
parent 6648319c62
commit fee447fae8
2 changed files with 11 additions and 6 deletions

View File

@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog
- bug server_privileges.js: cannot read property
- bug #4527 Importing ODS files with column names having trailing spaces fails
- bug #4413 Navigation Error in Nav Tree for Search Results Past the First Page
- bug functions.js: Cannot read property 'replace' of undefined
4.2.7.1 (2014-08-17)
- bug #4501 [security] XSS in table browse page

View File

@ -3835,12 +3835,16 @@ function PMA_clearSelection() {
* HTML escaping
*/
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
if (typeof(unsafe) != 'undefined') {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
} else {
return false;
}
}
/**