Closed nerun closed 7 months ago
Thanks for reporting again. Why does (int)$INFO['userinfo'] ?? 0;
not work, probably because casting to (int) is performed before the null coalescing operator ??
?
No idea. I have tested both in PHP Sandbox and DokuWiki and the previous way is the only one.
My code in PHP sandbox, just for testing:
<?php
//$INFO = array('userinfo' => 3);
//$INFO = array('userinfo' => null);
$INFO = array();
//$JSINFO['isauth'] = (int)$INFO['userinfo'] ?? 0;
$JSINFO['isauth'] = isset($INFO['userinfo']) ? (int) $INFO['userinfo'] : 0;
print_r($JSINFO);
Merged, thanks!
This is the same issue as #247, closed. Apparently it was fixed by the already merged PR #134. But the changes made by that PR were
partially
undone. Now i receive TONS of warnings, ALL them related to this single issue:I will submit a PR to change action.php line 71 from:
Back to the same as PR #134: