WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12334 closed defect (bug) (fixed)

A series of typos/thinkos that should be fixed

Reported by: rlerdorf Owned by: 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)

comment:1 rlerdorf4 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.

comment:2 nacin4 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.

comment:3 nacin4 years ago

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

comment:4 rmccue4 years ago

  • Cc me@… added

Fixed upstream in b105382

comment:5 markmcwilliams4 years ago

Can this be closed now?

comment:6 nacin4 years ago

No, still haven't gone through default_password_nag_edit_user.

comment:7 westi4 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.

comment:8 westi4 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.

comment:9 westi4 years ago

  • Description modified (diff)

Fix the formatting :-)

Note: See TracTickets for help on using tickets.