[wp-trac] Re: [WordPress Trac] #8317: New installs: admin has user_level 0

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 26 00:10:23 GMT 2008


#8317: New installs: admin has user_level 0
---------------------+------------------------------------------------------
 Reporter:  Mr Pete  |        Owner:  jacobsantos
     Type:  defect   |       Status:  new        
 Priority:  normal   |    Milestone:  2.8        
Component:  Upgrade  |      Version:  2.5        
 Severity:  major    |   Resolution:             
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by Mr Pete):

 Return-by-reference is a critical issue any time the caller needs to
 modify the referenced object.

 Here's a complete list of core function declarations that return
 references. I marked them based on the code comments, using a quick
 inspection:

 * "AAA" claim to return array (reference)

 * "***" claim to be capable of returning an object (reference)

 * "xxx" return nothing or something else

 AFAIK, only the eleven "***" functions might be a problem.

 {{{
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\capabilities.php'
 :
 *** E:\tech\cvs\wp\temp\wp-includes\capabilities.php(213):      function
 &get_role( $role ) {
 Found 'function\s*\&' 1 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\category.php' :
 AAA E:\tech\cvs\wp\temp\wp-includes\category.php(39): function
 &get_categories( $args = '' ) {
 *** E:\tech\cvs\wp\temp\wp-includes\category.php(76): function
 &get_category( $category, $output = OBJECT, $filter = 'raw' ) {
 AAA E:\tech\cvs\wp\temp\wp-includes\category.php(277): function &get_tags(
 $args = '' ) {
 *** E:\tech\cvs\wp\temp\wp-includes\category.php(309): function &get_tag(
 $tag, $output = OBJECT, $filter = 'raw' ) {
 Found 'function\s*\&' 4 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\comment.php' :
 *** E:\tech\cvs\wp\temp\wp-includes\comment.php(133): function
 &get_comment(&$comment, $output = OBJECT) {
 AAA E:\tech\cvs\wp\temp\wp-includes\comment.php(485): function
 &separate_comments(&$comments) {
 Found 'function\s*\&' 2 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\http.php' :
 *** E:\tech\cvs\wp\temp\wp-includes\http.php(90):       function
 &_getTransport( $args = array() ) {
 *** E:\tech\cvs\wp\temp\wp-includes\http.php(138):      function
 &_postTransport( $args = array() ) {
 *** E:\tech\cvs\wp\temp\wp-includes\http.php(1063): function
 &_wp_http_get_object() {
 Found 'function\s*\&' 3 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\post.php' :
 *** E:\tech\cvs\wp\temp\wp-includes\post.php(116): function
 &get_children($args = '', $output = OBJECT) {
 *** E:\tech\cvs\wp\temp\wp-includes\post.php(209): function
 &get_post(&$post, $output = OBJECT, $filter = 'raw') {
 *** E:\tech\cvs\wp\temp\wp-includes\post.php(1891): function
 &get_page(&$page, $output = OBJECT, $filter = 'raw') {
 AAA E:\tech\cvs\wp\temp\wp-includes\post.php(1979): function
 &get_page_children($page_id, $pages) {
 AAA E:\tech\cvs\wp\temp\wp-includes\post.php(2054): function
 &get_pages($args = '') {
 *** E:\tech\cvs\wp\temp\wp-includes\post.php(3446): function
 &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
 Found 'function\s*\&' 6 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\query.php' :
 AAA E:\tech\cvs\wp\temp\wp-includes\query.php(59): function
 &query_posts($query) {
 AAA E:\tech\cvs\wp\temp\wp-includes\query.php(1562):    function
 &get_posts() {
 AAA E:\tech\cvs\wp\temp\wp-includes\query.php(2499):    function
 &query($query) {
 Found 'function\s*\&' 3 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\taxonomy.php' :
 E:\tech\cvs\wp\temp\wp-includes\taxonomy.php(299): function
 &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
 AAA E:\tech\cvs\wp\temp\wp-includes\taxonomy.php(589): function
 &get_terms($taxonomies, $args = '') {
 AAA E:\tech\cvs\wp\temp\wp-includes\taxonomy.php(1807): function
 &get_object_term_cache($id, $taxonomy) {
 AAA E:\tech\cvs\wp\temp\wp-includes\taxonomy.php(1957): function
 &_get_term_children($term_id, $terms, $taxonomy) {
 Found 'function\s*\&' 4 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\EnchantSpell.php' :
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\EnchantSpell.php(20):
 function &checkWords($lang, $words) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\EnchantSpell.php(49):
 function &getSuggestions($lang, $word) {
 Found 'function\s*\&' 2 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\GoogleSpell.php' :
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\GoogleSpell.php(18):
 function &checkWords($lang, $words) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\GoogleSpell.php(36):
 function &getSuggestions($lang, $word) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\GoogleSpell.php(53):
 function &_getMatches($lang, $str) {
 Found 'function\s*\&' 3 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpell.php' :
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpell.php(18):
 function &checkWords($lang, $words) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpell.php(37):
 function &getSuggestions($lang, $word) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpell.php(49):
 function &_getPLink($lang) {
 Found 'function\s*\&' 3 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpellShell.php' :
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpellShell.php(18):
 function &checkWords($lang, $words) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\PSpellShell.php(60):
 function &getSuggestions($lang, $word) {
 Found 'function\s*\&' 2 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\SpellChecker.php' :
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\SpellChecker.php(26):
 function &loopback(/* args.. */) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\SpellChecker.php(37):
 function &checkWords($lang, $words) {
 AAA E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\classes\SpellChecker.php(48):
 function &getSuggestions($lang, $word) {
 Found 'function\s*\&' 3 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\includes\general.php' :
 *** E:\tech\cvs\wp\temp\wp-
 includes\js\tinymce\plugins\spellchecker\includes\general.php(44):
 function &getLogger() {
 Found 'function\s*\&' 1 time(s).
 ----------------------------------------
 Find 'function\s*\&' in 'E:\tech\cvs\wp\temp\wp-includes\Text\Diff.php' :
 xxx E:\tech\cvs\wp\temp\wp-includes\Text\Diff.php(308):     function
 &reverse()
 xxx E:\tech\cvs\wp\temp\wp-includes\Text\Diff.php(342):     function
 &reverse()
 xxx E:\tech\cvs\wp\temp\wp-includes\Text\Diff.php(364):     function
 &reverse()
 xxx E:\tech\cvs\wp\temp\wp-includes\Text\Diff.php(386):     function
 &reverse()
 xxx E:\tech\cvs\wp\temp\wp-includes\Text\Diff.php(408):     function
 &reverse()
 Found 'function\s*\&' 5 time(s).
 Search complete, found 'function\s*\&' 42 time(s). (14 files.)
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8317#comment:26>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list