From 4b030ce797e5645d4a29543c5dd004c97a99b3ca Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 25 Jul 2007 23:13:24 +0200 Subject: skipempty parameter for buildAttributes darcs-hash:20070725211324-7ad00-97ee12f6e28ab8298775218adbcb571a3b79c2d6.gz --- inc/common.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index 3bdfc7c72..bed083392 100644 --- a/inc/common.php +++ b/inc/common.php @@ -197,10 +197,11 @@ function buildURLparams($params, $sep='&'){ * * @author Andreas Gohr */ -function buildAttributes($params){ +function buildAttributes($params,$skipempty=false){ $url = ''; foreach($params as $key => $val){ if($key{0} == '_') continue; + if(empty($val) && $skipempty) continue; $url .= $key.'="'; $url .= htmlspecialchars ($val); -- cgit v1.2.3