Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
4058 | minor | always | 06-01-10 03:11 | 06-01-10 03:11 | |
|
|||||
Reporter: | sblommers | Platform: | |||
Assigned To: | OS: | ||||
Priority: | normal | OS Version: | |||
Status: | new | Product Version: | 4.0.8 | ||
Product Build: | SVN | Resolution: | open | ||
Projection: | none | ||||
ETA: | none | Fixed in Version: | |||
|
|||||
Summary: | 0004058: print_r not going through whole array when references are used | ||||
Description: |
OUTPUT on APACHE+PHP: BEFORE SANITIZE: Array ( [0] => Array ( [0] => Array ( [0] => 0 [1] => 1 [2] => 2 ) [1] => 3 [2] => 4 ) [1] => 5 [2] => 6 ) AFTER SANITIZE: Array ( [0] => Array ( [0] => Array ( [0] => \0 [1] => \1 [2] => \2 ) [1] => \3 [2] => \4 ) [1] => \5 [2] => \6 ) OUTPUT on QUERCUS: BEFORE SANITIZE: Array ( [0] => Array ( [0] => Array ( [0] => 0 [1] => 1 [2] => 2 ) [1] => 3 [2] => 4 ) [1] => 5 [2] => 6 ) AFTER SANITIZE: Array ( [0] => Array [1] => \5 [2] => \6 ) |
||||
Steps To Reproduce: |
<?php // Sanitize as a function to allow recursing; original array passed by reference function sanitize(&$array) { foreach ($array as &$data) { if (!is_array($data)) // If it's not an array, clean it $data = '\\' . $data; // addslashes(), mysql_real_escape_string() or whatever you wish to use, this is merely a simple example else // If it IS an array, call the function on it sanitize($data); } } // Test case $test = array( array( array( 0, 1, 2 ), 3, 4 ), 5, 6 ); // Output echo "BEFORE SANITIZE: "; print_r($test); sanitize($test); echo " AFTER SANITIZE: "; print_r($test); ?> |
||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
There are no notes attached to this issue. |