Opened 15 years ago
Closed 13 years ago
#16754 closed enhancement (fixed)
PHP5-port - srand()
| Reported by: | hakre | Owned by: | dd32 |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Formatting | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
Attachments (3)
Change History (17)
#2
@
15 years ago
- Version 3.1 → 3.3
- Removed srand()
- There's no reason to do floor(rand()) when rand() always returns an integer.
- Renamed $emailNOSPAMaddy to $email_no_spam_addy to match Coding Standards
- Replaced "$i = $i + 1" with "$i++" which is more common in WordPress
#3
@
15 years ago
- Version 3.3 → 3.1
Version field indicates when the enhancement was initially suggested.
#4
@
13 years ago
- Keywords close added; has-patch removed
- Resolution → maybelater
- Status new → closed
Closing as maybe later. See: http://make.wordpress.org/core/2011/03/23/code-refactoring/
#6
@
13 years ago
- Milestone → 3.7
- Resolution maybelater
- Status closed → reopened
Actually, removing srand() and floor() seems valid here. It's removing obsolete and redundant code, not just a readability enhancement.
#10
@
13 years ago
It's not going to affect the functionality but it does look like there's a typo in the docblock - line 1487 reads @param int $extra_entrpoy rather than @param int $extra_entropy
#12
@
13 years ago
I'd argue that $extra_entropy is a misleading name for the variable. 16754.diff switches to $hex_encoding and uses array style character access instead of substr().
#13
@
13 years ago
- Resolution fixed
- Status closed → reopened
I agree that it's not exactly a great name, and am fine with it being changed (anything was better than $mailto)
At first, $hex_encoding doesn't feel right, because it just randomly hex's characters, it doesn't turn it on for the entire link, but at the same time, it does what it says on the box, enables some hex encoding.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Probably this just was forgotten