Opened 15 years ago
Closed 12 years ago
#11630 closed defect (bug) (fixed)
0 is not a valid cache key for posts
Reported by: | hakre | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Cache API | Keywords: | |
Focuses: | Cc: |
Description
input sanitization just in case.
Attachments (3)
Change History (12)
#1
@
15 years ago
Reviewed the core code now for appeareances. Found only one where this applies (can not speak for third party code and this is an API function).
the .2 + .3 patch could be merged for an overall improvement.
#2
@
15 years ago
- Keywords dev-feedback added
Would like to see some developer feedback on this one.
#3
@
15 years ago
- Component changed from General to Cache
- Keywords dev-feedback removed
- Milestone changed from Future Release to 3.0
- Owner set to ryan
how does 0 ever get fetched in the first place?
#5
@
14 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
Re-open with steps to reproduce etc.
#6
@
14 years ago
- Milestone set to 3.1
- Resolution worksforme deleted
- Status changed from closed to reopened
This is not per reproduce, this is per spec. We make the assumption, in the object cache in general, and memcached in particular, that a key is not empty. Zero is empty.
#7
@
14 years ago
Both 0 and '0' are valid array keys. The built in object cache uses isset() not empty() to determine if the requested object is stored in cache.
Recommending close.
Alternate patch allowing 0 to better reflect the API. various comment and naming-consistency improvements.