| Conditions | 3 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 16 | protected function _generateNonce(string $name, ?int $value = null): string { |
||
| 17 | $bytes = \random_bytes((int) ($value ?? 32)); |
||
| 18 | $nonce = \base64_encode($bytes); |
||
| 19 | if (isset($this->onNonce) && ! URequest::isAjax()) { |
||
| 20 | $onNonce = $this->onNonce; |
||
| 21 | $onNonce($name, $nonce); |
||
| 22 | } |
||
| 23 | return $nonce; |
||
| 24 | } |
||
| 54 |