|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 4929 | major | always | 01-24-12 06:39 | 06-21-12 01:23 | |
|
|
|||||
| Reporter: | jgilje | Platform: | |||
| Assigned To: | nam | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 4.0.14 | ||
| Product Build: | Resolution: | unable to reproduce | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | |||
|
|
|||||
| Summary: | 0004929: Array is passed as reference, even though function is defined as pass-by-value | ||||
| Description: |
Using the latest version of wordpress, I had trouble using the page-editor. On wp-admin/edit.php?post_type=page no edit links appear. I narrowed the bug down to the global variable $wp_post_types getting corrupted by the callstack starting at wp-admin/includes/post.php - line 852 - call to get_post_types(); wp-includes/post.php - line 854 - call to wp_filter_object_list(); wp-includes/functions.php - 3228 - call to wp_list_pluck(); wp-includes/functions.php - 3286 - definition of wp_list_pluck(); After the call to wp_list_pluck(), $wp_post_types is corrupted. However, if changing the function wp_list_pluck() to create a copy of its $list parameter as follows function wp_list_pluck( $list, $field ) { $ret = array(); foreach ( $list as $key => $value ) { if ( is_object( $value ) ) $ret[ $key ] = $value->$field; else $ret[ $key ] = $value[ $field ]; } return $ret; } it works perfectly. To me, this seems as the $list variable passed to wp_list_pluck() is assigned by reference and not by value through the callstack coming from get_post_types() in wp-includes/post.php - even though the functions involved does not specify pass-by-reference. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: |
|
||||
| Notes | |||||
|
|
|||||
|
|
||||