fix makePopupLink when condition is false

pull/2867/head
Isaac Connor 2020-03-02 16:10:56 -05:00
parent c1e13221f7
commit 85e5ade07a
1 changed files with 2 additions and 2 deletions

View File

@ -436,9 +436,9 @@ function makeLink($url, $label, $condition=1, $options='') {
*/
function makePopupLink($url, $winName, $winSize, $label, $condition=1, $options='') {
// Avoid double-encoding since some consumers incorrectly pass a pre-escaped URL.
$string = '<a class="popup-link" href="' . htmlspecialchars($url, ENT_COMPAT | ENT_HTML401, ini_get("default_charset"), false) . '"';
$string .= ' data-window-name="' . htmlspecialchars($winName) . '"';
if ( $condition ) {
$string = '<a class="popup-link" href="' . htmlspecialchars($url, ENT_COMPAT | ENT_HTML401, ini_get('default_charset'), false) . '"';
$string .= ' data-window-name="' . htmlspecialchars($winName) . '"';
if ( is_array( $winSize ) ) {
$string .= ' data-window-tag="' . htmlspecialchars($winSize[0]) . '"';
$string .= ' data-window-width="' . htmlspecialchars($winSize[1]) . '"';