enwikipedia-acc /
waca
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /****************************************************************************** |
||
| 3 | * Wikipedia Account Creation Assistance tool * |
||
| 4 | * * |
||
| 5 | * All code in this file is released into the public domain by the ACC * |
||
| 6 | * Development Team. Please see team.json for a list of contributors. * |
||
| 7 | ***************************************************************************** |
||
| 8 | * |
||
| 9 | * @param array $list |
||
| 10 | * @param string $conjunction |
||
| 11 | * |
||
| 12 | * @return string |
||
| 13 | */ |
||
| 14 | |||
| 15 | function smarty_modifier_nlimplode($list, $conjunction = 'or') |
||
| 16 | { |
||
| 17 | $last = array_pop($list); |
||
| 18 | if ($list) { |
||
|
0 ignored issues
–
show
|
|||
| 19 | return implode(', ', $list) . ', ' . $conjunction . ' ' . $last; |
||
| 20 | } |
||
| 21 | return $last; |
||
| 22 | } |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.