Support from Acquia helps fund testing for Drupal Acquia logo

Comments

junedkazi’s picture

Title: Handle array in query parameters » Update drupal_get_query_array function to handle array in query parameters
junedkazi’s picture

Component: other » base system

Status: Needs review » Needs work

The last submitted patch, drupal_get_query_array_support.patch, failed testing.

junedkazi’s picture

Status: Needs work » Needs review
FileSize
846 bytes

Status: Needs review » Needs work

The last submitted patch, drupal_get_query_array_support-2023815-4.patch, failed testing.

junedkazi’s picture

Status: Needs work » Needs review
FileSize
804 bytes
junedkazi’s picture

Title: Update drupal_get_query_array function to handle array in query parameters » Update drupal_get_query_array function to handle same name array in query parameters
junedkazi’s picture

Priority: Normal » Major
dlu’s picture

Component: base system » database system

Moved to database system per #2050763-16: Refine "base system" component (notes on refactoring of "base system" category here: https://docs.google.com/a/acquia.com/spreadsheet/ccc?key=0AusehVccVSq2dF...).

xjm’s picture

Status: Needs review » Needs work

The last submitted patch, 6: drupal_get_query_array_support-2023815-6.patch, failed testing.

cilefen’s picture

Issue summary: View changes
Status: Needs work » Closed (works as designed)
Issue tags: +Needs tests

But parse_str() is subject to php max_input_vars limitation and there are sites that use parse_str() to parse things that aren't directly coming from users query args.

Ok, but the suggestion in the change record is for processing URL query parameters. max_input_vars defaults to 1000 on my system. It doesn't seem like a real problem in this case so I don't think this is a real-world problem.

Furthermore, parse_str() works in this case, so this issue is effectively solved:


parse_str('foo[]=1&foo[]=2&foo[]=3', $foo);
print_r($foo);

Output:

Array
(
    [foo] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)

And, #1597784: [Performance]: drupal_get_query_array should be replaced with parse_str eliminated drupal_get_query_array().

cilefen’s picture

Issue tags: -Needs tests

Oops.

David_Rothstein’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Closed (works as designed) » Needs work

I think this is still valid for Drupal 7.

rafaolf’s picture

I did not consider nested arrays for that solution, as we are talking about a query parameter. Also, the regex quantifier is a lazy one instead of greedy for the same reason.

Status: Needs review » Needs work

The last submitted patch, 15: 2023815-15.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.