Skip to content

Commit 8232c5c

Browse files
committed
remove support for getBytesFromString("",0);
for consistency, I would prefer to actually support this, but TimWolla disagrees, and i cba fighting for it (it's an edge-case after all): #12216 (comment)
1 parent c56fe83 commit 8232c5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/random/randomizer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ PHP_METHOD(Random_Randomizer, getBytesFromString)
390390
const size_t source_length = ZSTR_LEN(source);
391391
const size_t max_offset = source_length - 1;
392392

393-
if (source_length < 1 && length > 0) {
394-
zend_argument_value_error(1, "cannot be empty when argument #2 ($length) is greater than 0");
393+
if (source_length < 1) {
394+
zend_argument_value_error(1, "cannot be empty");
395395
RETURN_THROWS();
396396
}
397397

0 commit comments

Comments
 (0)