Update:Archive/1.0/Developers: Difference between revisions

Jump to navigation Jump to search
m
Line 530: Line 530:
** Check to see if HTTP_USER_AGENT is empty or not before doing any checks on it
** Check to see if HTTP_USER_AGENT is empty or not before doing any checks on it
** > 0 is not sufficient; it should be !== FALSE since strpos can return 0 as a valid return
** > 0 is not sufficient; it should be !== FALSE since strpos can return 0 as a valid return
** Code comments indicate 1-6, checks provide IDs 0,2,3,4,5,6
** Code comments indicate 1-6, checks provide IDs 0,2,3,4,5,6 (alanjstr says: replace this with names, not ints)
** (alanjstr says: replace this with names, not ints)
** Use logic to create short-circuit; right now it's all if's so the checks will happen even after a match is found and $osid is set -- logically, it's possible for $osid to be set twice
** Use logic to create short-circuit; right now it's all if's so the checks will happen even after a match is found and $osid is set -- logically, it's possible for $osid to be set twice
* [234] Query in a loop.  Remove this.  This could be replaced with an IN( explode(','$reqItemGuid) ) instead of $reqItemGuid[$i] in the query (assuming some checks on $reqItemGuid before the explode()), reducing the number of queries from count($reqItemGuid) to 1 since $osid and $reqTargetAppGuid are the same.
* [234] Query in a loop.  Remove this.  This could be replaced with an IN( explode(','$reqItemGuid) ) instead of $reqItemGuid[$i] in the query (assuming some checks on $reqItemGuid before the explode()), reducing the number of queries from count($reqItemGuid) to 1 since $osid and $reqTargetAppGuid are the same.
** (alanjstr says: good catch.  This is new code, so it only handles 1 at a time right now)
** (alanjstr says: good catch.  This is new code, so it only handles 1 at a time right now)
* [253] Is there any way to avoid this OR ?
* [253] Is there any way to avoid this OR ?
244

edits

Navigation menu