Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Fix getting random character from charset #10

Merged
merged 1 commit into from Jan 7, 2019
Merged

Fix getting random character from charset #10

merged 1 commit into from Jan 7, 2019

Conversation

JensSpanier
Copy link
Contributor

If strlen($possible) is for example 36, rand could also return 36. But substr starts with position 0. So we have to subtract 1 from strlen($possible).

If strlen($possible) is for example 36, rand could also return 36. But substr starts with position 0. So we have to subtract 1 from strlen($possible).
Copy link
Member

@LeoColomb LeoColomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit.
Thanks @Virinum!

@ozh ozh merged commit addccdb into YOURLS:master Jan 7, 2019
@ozh
Copy link
Member

ozh commented Jan 7, 2019

Thanks !

dgw pushed a commit to dgw/YOURLS that referenced this pull request Sep 22, 2019
If strlen($possible) is for example 36, rand could also return 36.
But substr starts with position 0. So we have to subtract 1 from
strlen($possible).

----

Yoinked from YOURLS/random-keywords#10 by @dgw
dgw pushed a commit to dgw/YOURLS that referenced this pull request Sep 27, 2019
If strlen($possible) is for example 36, rand could also return 36.
But substr starts with position 0. So we have to subtract 1 from
strlen($possible).

----

Yoinked from YOURLS/random-keywords#10 by @dgw
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants