| @@ 128-144 (lines=17) @@ | ||
| 125 | return FALSE; |
|
| 126 | } |
|
| 127 | ||
| 128 | if (($type = gettype($iterations)) !== 'integer') |
|
| 129 | { |
|
| 130 | if ($type === 'object' && method_exists($iterations, '__toString')) |
|
| 131 | { |
|
| 132 | $iterations = (string) $iterations; |
|
| 133 | } |
|
| 134 | ||
| 135 | if (is_string($iterations) && is_numeric($iterations)) |
|
| 136 | { |
|
| 137 | $iterations = (int) $iterations; |
|
| 138 | } |
|
| 139 | else |
|
| 140 | { |
|
| 141 | trigger_error('hash_pbkdf2() expects parameter 4 to be long, '.$type.' given', E_USER_WARNING); |
|
| 142 | return NULL; |
|
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | if ($iterations < 1) |
|
| 147 | { |
|
| @@ 152-168 (lines=17) @@ | ||
| 149 | return FALSE; |
|
| 150 | } |
|
| 151 | ||
| 152 | if (($type = gettype($length)) !== 'integer') |
|
| 153 | { |
|
| 154 | if ($type === 'object' && method_exists($length, '__toString')) |
|
| 155 | { |
|
| 156 | $length = (string) $length; |
|
| 157 | } |
|
| 158 | ||
| 159 | if (is_string($length) && is_numeric($length)) |
|
| 160 | { |
|
| 161 | $length = (int) $length; |
|
| 162 | } |
|
| 163 | else |
|
| 164 | { |
|
| 165 | trigger_error('hash_pbkdf2() expects parameter 5 to be long, '.$type.' given', E_USER_WARNING); |
|
| 166 | return NULL; |
|
| 167 | } |
|
| 168 | } |
|
| 169 | ||
| 170 | if ($length < 0) |
|
| 171 | { |
|