Skip to content

Commit

Permalink
♻️ Rename flag to better show actual effect
Browse files Browse the repository at this point in the history
This flag only causes parameters with empty strings to be skipped,
not all empty() values.
  • Loading branch information
micgro42 committed Jun 29, 2018
1 parent fdbbfed commit 8fd9398
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inc/common.php
Expand Up @@ -356,16 +356,16 @@ function buildURLparams($params, $sep = '&') {
*
* @author Andreas Gohr
*
* @param array $params array with (attribute name-attribute value) pairs
* @param bool $skipempty skip empty string values?
* @param array $params array with (attribute name-attribute value) pairs
* @param bool $skipEmptyStrings skip empty string values?
* @return string
*/
function buildAttributes($params, $skipempty = false) {
function buildAttributes($params, $skipEmptyStrings = false) {
$url = '';
$white = false;
foreach($params as $key => $val) {
if($key{0} == '_') continue;
if($val === '' && $skipempty) continue;
if($val === '' && $skipEmptyStrings) continue;
if($white) $url .= ' ';

$url .= $key.'="';
Expand Down

0 comments on commit 8fd9398

Please sign in to comment.