[buddypress-trac] [BuddyPress Trac] #6977: Audit all DB fetch methods to return integers where appropriate
buddypress-trac
noreply at wordpress.org
Wed Mar 23 17:17:15 UTC 2016
#6977: Audit all DB fetch methods to return integers where appropriate
---------------------------------+-----------------------------
Reporter: r-a-y | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Component - Any/All | Version:
Severity: normal | Keywords: dev-feedback
---------------------------------+-----------------------------
When we populate an item from the database, sometimes the incorrect data
type is returned. For example, integers are returned as strings.
As a result, some functions that rely on strict type comparison can fail.
#6969 is an example of this.
For 2.6, it might be a good idea to audit all our DB fetch methods so
numeric strings are cast to integers.
Attached patch is an example that fixes up the `BP_Friends_Friendship`
class to do this.
Let me know what you think and whether you see any issues with this
approach.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6977>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list