Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 May 2012 at 15:13 UTC
Updated:
17 Jul 2012 at 06:11 UTC
Jump to comment: Most recent file
The fix committed in #1395548: services_resource_build_index_query provides no way of querying values with commas endlessly loops on PHP 5.2 machines (which don't have str_getcsv())
Reproduce with http://localhost/api/user?parameters[name]=12345
Downgrading services from dev to stable fixed the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 1569376-services-str_getcsv-loop-10.patch | 520 bytes | djdevin |
| #8 | 1569376-services-str_getcsv-loop-8.patch | 474 bytes | djdevin |
| #5 | 1569376-services-str_getcsv-loop-5.patch | 488 bytes | djdevin |
Comments
Comment #1
kylebrowning commentedif (!function_exists('str_getcsv')) {
should stop it from running on a machine that doesn't have it.
Are you sure thats where the problem lies?
Comment #2
kylebrowning commentedoh i guess my bad I read that code wrong. THere is a ! in front of it.
Ill look into it.
Comment #3
djdevinThanks, the while() loop never ends. There's a few replacements for str_getcsv in PHP 5.2, maybe that one just doesn't work.
Grabbed the str_getcsv replacement and threw it into PHP, just to make sure it wasn't anything in Drupal:
Comment #4
djdevinGot it - in PHP 5.2 the last argument ($escape) doesn't exist, triggering a function warning.
Remove $escape and it seems to work.
Comment #5
djdevinPatch for the record.
Comment #6
marcingy commentedThis needs to be fixed in d7 first - assuming the patch applies cleanly and marking as RTBC
Comment #7
djdevinNow that I think about it, I think this still might be wrong in both versions for PHP 5.2
str_getcsv returns an indexed array of fields (1 row). But, the PHP 5.2 equivalent seems to be returning a nested indexed array of fields (multiple rows)...right?
Comment #8
djdevinI think it should be something like this instead.
Comment #10
djdevinPatch for 7x
Comment #11
djdevinComment #12
franzPatch on #10 worked well for me.
Comment #13
ygerasimov commentedThank you a lot for the patch.
Comment #14
kylebrowning commentedComment #15
djdevinCan we port this to 6.x-3.x too? Fix should be the same.
Comment #16
ygerasimov commentedCommitted to 6.x-3.x branch.