From: Jehan-Guillaume (ioguix) de Rorthais Date: Mon, 5 Dec 2011 21:46:48 +0000 (+0100) Subject: Refactor printActionUrl as getActionUrl X-Git-Tag: REL_5-1-0~76 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=a9ad700b67b63d581693406cda2cd8e7833818cc;p=phppgadmin.git Refactor printActionUrl as getActionUrl remove useless parameters and make it simpler. Takes part in the pavement for WIP plugin architecture. --- diff --git a/classes/Misc.php b/classes/Misc.php index d8e94790..46e0b88d 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -630,7 +630,7 @@ if (!isset($tab['hide']) || $tab['hide'] !== true) { - $tablink = "printActionUrl($tab, $_REQUEST, 'href') . ">"; + $tablink = ''; if (isset($tab['icon']) && $icon = $this->icon($tab['icon'])) $tablink .= "\"{$tab['title']}\""; @@ -1601,17 +1601,15 @@ } /** - * Display a URL given an action associative array. + * Returns URL given an action associative array. + * NOTE: this function does not html-escape, only url-escape * @param $action An associative array of the follow properties: * 'url' => The first part of the URL (before the ?) * 'urlvars' => Associative array of (URL variable => field name) * these are appended to the URL - * 'urlfn' => Function to apply to URL before display * @param $fields Field data from which 'urlfield' and 'vars' are obtained. - * @param $attr If supplied then the URL will be quoted and prefixed with - * '$attr='. */ - function printActionUrl(&$action, &$fields, $attr = null) { + function getActionUrl(&$action, &$fields) { $url = value($action['url'], $fields); if ($url === false) return ''; @@ -1641,12 +1639,7 @@ $sep = '&'; } - $url = htmlentities($url, ENT_QUOTES, 'UTF-8'); - - if ($attr !== null && $url != '') - return ' '.$attr.'="'.$url.'"'; - else - return $url; + return $url; } function getRequestVars($subject = '') {