WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#43568 closed defect (bug) (fixed)

E_WARNING: sprintf(): Too few arguments. [ wp-activate.php wp-activate.php (113) ]

Reported by: conner_bw Owned by: ocean90
Milestone: 4.9.5 Priority: normal
Severity: normal Version: 4.9
Component: Networks and Sites Keywords: good-first-bug has-patch
Focuses: multisite Cc:

Description

We keep seeing E_WARNING: sprintf(): Too few arguments. [ wp-activate.php wp-activate.php (113) ] In our New Relic logs.

The problem is this line:

Source

<?php
sprintf( '<a href="http://%s">%s</a>', $signup->domain )

Count the number of %s. Count the args. Should probably be:

<?php
sprintf( '<a href="http://%s">%s</a>', $signup->domain, $signup->domain )

Thanks.

Attachments (2)

43568.diff (905 bytes) - added by Thomas Vitale 3 months ago.
43568.2.diff (892 bytes) - added by Thomas Vitale 3 months ago.
Changed %s to a numbered placeholder

Download all attachments as: .zip

Change History (6)

#1 @ocean90
3 months ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 4.9.5
  • Version changed from 4.9.4 to 4.9

Introduced in [41579]. %s can be changed to a numbered placeholder.

@Thomas Vitale
3 months ago

#2 @Thomas Vitale
3 months ago

  • Keywords has-patch added; needs-patch removed

@Thomas Vitale
3 months ago

Changed %s to a numbered placeholder

#3 @ocean90
3 months ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 42844:

Multisite: Use a numbered placeholder in sprintf() for the site URL.

Fixes missing site domain in the link and a PHP warning.

Props Thomas Vitale, conner_bw.
See #41645.
Fixes #43568.

#4 @ocean90
3 months ago

In 42845:

Multisite: Use a numbered placeholder in sprintf() for the site URL.

Fixes missing site domain in the link and a PHP warning.

Merge of [42844] to the 4.9 branch.

Props Thomas Vitale, conner_bw.
See #41645, #43568.

Note: See TracTickets for help on using tickets.