Commit 3d43c19b25a25564ae454cf154ba75b866638b6c

Authored by nbm
1 parent 041bd424

Add addQueryString, which takes an existing URL (potentially with query

string) and appends a query string to it.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4440 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 12 additions and 0 deletions
lib/util/ktutil.inc
... ... @@ -437,6 +437,18 @@ class KTUtil {
437 437 return false;
438 438 }
439 439 // }}}
  440 +
  441 + // {{{ addQueryString
  442 + function addQueryString($url, $qs) {
  443 + require_once(KT_DIR . '/thirdparty/pear/Net/URL.php');
  444 + $oUrl = new Net_URL($url);
  445 + $aQs = $oUrl->_parseRawQuerystring($qs);
  446 + foreach ($aQs as $k => $v) {
  447 + $oUrl->addQueryString($k, $v);
  448 + }
  449 + return $oUrl->getUrl();
  450 + }
  451 + // }}}
440 452 }
441 453  
442 454 ?>
... ...