Skip to content

Commit

Permalink
add missing string escapes
Browse files Browse the repository at this point in the history
don't create <a> tag if LeftLogoLink is empty
  • Loading branch information
piotrp committed Jul 14, 2010
1 parent 030abc5 commit 60285cd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion libraries/header_scripts.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
// Updates the title of the frameset if possible (ns4 does not allow this)
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
&& typeof(parent.document.title) == 'string') {
parent.document.title = '<?php echo PMA_sanitize(PMA_escapeJsString($title)); ?>';
parent.document.title = '<?php echo PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))); ?>';
}

<?php
Expand Down
34 changes: 19 additions & 15 deletions libraries/navigation_header.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,26 @@
.'alt="' . $logo . '" id="imgpmalogo" />';
}

echo '<div id="pmalogo">' . "\n"
.'<a href="' . $GLOBALS['cfg']['LeftLogoLink'];
switch ($GLOBALS['cfg']['LeftLogoLinkWindow']) {
case 'new':
echo '" target="_blank"';
break;
case 'main':
// do not add our parameters for an external link
if (substr(strtolower($GLOBALS['cfg']['LeftLogoLink']), 0, 4) !== 'http') {
echo '?' . $query_url . '" target="frame_content"';
} else {
echo '"';
}
echo '<div id="pmalogo">' . "\n";
if ($GLOBALS['cfg']['LeftLogoLink']) {
echo '<a href="' . htmlspecialchars($GLOBALS['cfg']['LeftLogoLink']);
switch ($GLOBALS['cfg']['LeftLogoLinkWindow']) {
case 'new':
echo '" target="_blank"';
break;
case 'main':
// do not add our parameters for an external link
if (substr(strtolower($GLOBALS['cfg']['LeftLogoLink']), 0, 4) !== '://') {
echo '?' . $query_url . '" target="frame_content"';
} else {
echo '" target="_blank"';
}
}
echo '>' . $logo . '</a>' . "\n";
} else {
echo $logo . "\n";
}
echo '>' . $logo . '</a>' . "\n"
.'</div>' . "\n";
echo '</div>' . "\n";
} // end of display logo
?>
<div id="leftframelinks">
Expand Down

0 comments on commit 60285cd

Please sign in to comment.