Update addURLParameter to allow for a leading ?. re #40
这个提交存在于:
父节点
51a97f8e57
当前提交
f8f20f3d5c
共有 1 个文件被更改,包括 7 次插入 和 2 次删除
9
base.php
9
base.php
|
|
@ -175,14 +175,19 @@ function localize($phrase, $count=-1) {
|
|||
}
|
||||
|
||||
function addURLParameter($urlParams, $paramName, $paramValue) {
|
||||
$start = "";
|
||||
if (preg_match ("#^\?(.*)#", $urlParams, $matches)) {
|
||||
$start = "?";
|
||||
$urlParams = $matches[1];
|
||||
}
|
||||
$params = array();
|
||||
parse_str($urlParams, $params);
|
||||
if (empty ($paramValue)) {
|
||||
if (empty ($paramValue) && $paramValue != 0) {
|
||||
unset ($params[$paramName]);
|
||||
} else {
|
||||
$params[$paramName] = $paramValue;
|
||||
}
|
||||
return http_build_query($params);
|
||||
return $start . http_build_query($params);
|
||||
}
|
||||
|
||||
class Link
|
||||
|
|
|
|||
正在加载…
添加表格
添加链接
在新工单中引用