Skip to content

Commit

Permalink
Fix HTML rendering in error message, Issue #11872
Browse files Browse the repository at this point in the history
Signed-off-by: Durgesh <007durgesh219@gmail.com>
  • Loading branch information
007durgesh219 committed Feb 9, 2016
1 parent 6f55db7 commit de28889
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
30 changes: 18 additions & 12 deletions libraries/Util.php
Expand Up @@ -432,18 +432,23 @@ public static function formatSql($sqlQuery, $truncate = false)
/**
* Displays a link to the documentation as an icon
*
* @param string $link documentation link
* @param string $target optional link target
* @param string $link documentation link
* @param string $target optional link target
* @param boolean $bbcode optional flag indicating whether to output bbcode
*
* @return string the html link
*
* @access public
*/
public static function showDocLink($link, $target = 'documentation')
public static function showDocLink($link, $target = 'documentation', $bbcode = false)
{
return '<a href="' . $link . '" target="' . $target . '">'
. self::getImage('b_help.png', __('Documentation'))
. '</a>';
if($bbcode){
return "[a@$link@$target][dochelpicon][/a]";
}else{
return '<a href="' . $link . '" target="' . $target . '">'
. self::getImage('b_help.png', __('Documentation'))
. '</a>';
}
} // end of the 'showDocLink()' function

/**
Expand Down Expand Up @@ -549,16 +554,17 @@ public static function getDocuLink($page, $anchor = '')
/**
* Displays a link to the phpMyAdmin documentation
*
* @param string $page Page in documentation
* @param string $anchor Optional anchor in page
* @param string $page Page in documentation
* @param string $anchor Optional anchor in page
* @param boolean $bbcode Optional flag indicating whether to output bbcode
*
* @return string the html link
*
* @access public
*/
public static function showDocu($page, $anchor = '')
public static function showDocu($page, $anchor = '', $bbcode = false)
{
return self::showDocLink(self::getDocuLink($page, $anchor));
return self::showDocLink(self::getDocuLink($page, $anchor), 'documentation', $bbcode);
} // end of the 'showDocu()' function

/**
Expand Down Expand Up @@ -2180,8 +2186,8 @@ public static function checkParameters($params, $request = true)
$error_message .= $reported_script_name
. ': ' . __('Missing parameter:') . ' '
. $param
. self::showDocu('faq', 'faqmissingparameters')
. '<br />';
. self::showDocu('faq', 'faqmissingparameters',true)
. '[br]';
$found_error = true;
}
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/sanitizing.lib.php
Expand Up @@ -131,6 +131,8 @@ function PMA_sanitize($message, $escape = false, $safe = false)
'[/sup]' => '</sup>',
// used in common.inc.php:
'[conferr]' => '<iframe src="show_config_errors.php" />',
// used in libraries/Util.php
'[dochelpicon]' => PMA\libraries\Util::getImage('b_help.png', __('Documentation')),
);

$message = strtr($message, $replace_pairs);
Expand Down

0 comments on commit de28889

Please sign in to comment.