Make WordPress Core

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#12334 closed defect (bug) (fixed)

A series of typos/thinkos that should be fixed

Reported by: rlerdorf's profile rlerdorf Owned by: nacin's profile nacin
Milestone: 3.0 Priority: low
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description (last modified by westi)

In wp-includes/capabilities.php around line 773:

$cap_key = $wpdb->get_blog_prefix( $blog_id );
$cap_key. 'capabilities';

The author probably meant .= here.

In wp-admin/import/blogger.php around line 168:

} elseif ( $tag['tag'] == 'SUMMARY' ) {
	$blog['summary'] == $tag['value'];

The == on the second line there should obviously be just a single =

In wp-admin/includes/user.php around line 835:

function default_password_nag_edit_user($user_ID, $old_data) {
	global $user_ID;

The author overwrites the passed in $user_ID argument with the global version right away. This makes very little sense. Choose one or the other.

In wp-includes/class-simplepie.php around line 4070(!!) there are 3 lines of code that don't make sense:

(int) $seconds = array_pop($temp);
(int) $minutes = array_pop($temp);
(int) $hours = array_pop($temp);

Those casts don't do anything. The author probably meant to put the cast on the right hand side perhaps?

Change History (9)

#1 @rlerdorf
15 years ago

Oops, the formatting on the code snippets got messed up and brackets were dropped, but I think you can still get the gist of these.

#2 @nacin
15 years ago

  • Milestone changed from Unassigned to 3.0
  • Owner set to nacin
  • Status changed from new to accepted

Thanks for the report, sorry we overlooked it.

capabilities.php was fixed yesterday: [13666]

blogger.php was fixed today: [13684] after I saw your slides.

I'll look into default_password_nag_edit_user() -- it looks like it works correctly, but that we're doing too much work. I think we should be comparing the argument (the user who was just edited) to the global (logged in user), and returning if they don't match, as we're only worried about when the logged in user changes their own password (and that way we can clear the nag).

We can report the SimplePie casting upstream, and also make the change as well.

#3 @nacin
14 years ago

(In [13935]) Fix int cast usage in simplepie. see #12334, props rlerdorf.

#4 @rmccue
14 years ago

  • Cc me@… added

Fixed upstream in b105382

#5 @markmcwilliams
14 years ago

Can this be closed now?

#6 @nacin
14 years ago

No, still haven't gone through default_password_nag_edit_user.

#7 @westi
14 years ago

This looks like the global should go.

Basically the current code works for the user logged in but not if you edit another user which had the nag set.

#8 @westi
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [14608]) Fix the default password nag clearer to work when an admin sets someone elses password away from the default. Fixes #12334.

#9 @westi
14 years ago

  • Description modified (diff)

Fix the formatting :-)

Note: See TracTickets for help on using tickets.