Opened 5 years ago
Closed 5 years ago
#6906 closed defect (bug) (fixed)
syntax error in _deprecated_function() and _deprecated_file()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | General | Version: | 2.5.1 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
The functions _deprecated_function() and _deprecated_file() in wp-includes/functions.php contain lines like:
trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead."), $function, $version, $replacement ) );
The printf format strings seem to be bogus and cause PHP to complain when I put "define('WP_DEBUG',true);" in my wp-config.php:
[03-May-2008 17:35:17] PHP Notice: Undefined variable: s in /wordpress_root/wp-includes/functions.php on line 1708
I also see "is deprecated since version ! Use instead." inserted at the top of some pages. I'm quite sure those should be calls to sprintf and should contain correct format strings.
Attachments (1)
Change History (5)
JonathanRogers — 5 years ago
wp_deprecated.patch
%1$s Is a valid sprintf statement i believe.
Simply changing the quoting style to this should work:
sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.')
- Milestone changed from 2.7 to 2.5.2
%1$s is a valid format string - it allows for the translated string to use the included specifiers in a different order if they want.
However, they should definitely be calls to sprintf so that the return the string to pass to trigger_error and as DD32 suggests that quoting is all wrong.

Fixes deprecated function and file reporting