Issue Bug Closed

#31062Unable to use token=0 for -> split

Sebastiaan de Jonge 10/18/11, 12:21 updated 10/24/17, 20:19

Description

Due to an improper check on the token, it is not possible to use ‘0’ (zero) as a splitting character. See the code below:

$conf[‘token’] = isset($conf[‘token.’])                                                                                                                                                                
? $this->stdWrap($conf[‘token’], $conf[‘token.’])
: $conf[‘token’];
if (!$conf[‘token’]) {
return $value;
}

The part “if (!$conf[‘token’])” will return false if “$conf[‘token’]” is set to 0 (zero). A solution like the following should solve the problem.

$conf[‘token’] = isset($conf[‘token.’])                                                                                                                                                                
? $this->stdWrap($conf[‘token’], $conf[‘token.’])
: $conf[‘token’];
if (!$conf[‘token’] && $conf[‘token’] != ‘0’) {
return $value;
}

I will try to add a patch later today.

Reviews 3