[wp-trac] [WordPress Trac] #31983: Php warning

WordPress Trac noreply at wordpress.org
Wed Apr 15 17:29:02 UTC 2015


#31983: Php warning
--------------------------+-----------------------------
 Reporter:  olivier.pons  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.1.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The problem is on wp-includes/shortcodes.php line 280: it may sometimes
 generates warnings because $m[5] is set but $shortcode_tags[$tag] is not
 set.

 Just add those three lines after line 278:


 {{{
 279     if (!isset($shortcode_tags[$tag])) {
 280         return false;
 281     }

 }}}


 So no warning is raised. Here's a sample of the warning raised - just in
 case:


 {{{
 PHP Warning:  call_user_func() expects parameter 1 to be a valid callback,
 no array or string given in /mywebpath/wp-includes/shortcodes.php on line
 286, referer: http://mywebsite/wp-admin/post.php?post=ccc&action=edit
 PHP Stack trace:, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit
 PHP   1. {main}() /mywebpath/index.php:0, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit
 PHP   2. require() /mywebpath/index.php:17, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit
 PHP   3. require_once() /mywebpath/wp-blog-header.php:16, referer:
 http://mywebsite/wp-admin/post.php?post=ccc&action=edit
 PHP   4. include() /mywebpath/wp-includes/template-loader.php:74, referer:
 http://mywebsite/wp-admin/post.php?post=ccc&action=edit
 PHP   5. the_content() /mywebpath/wp-
 content/themes/krystallopolis/index.php:115, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit
 PHP   6. apply_filters() /mywebpath/wp-includes/post-template.php:221,
 referer: http://mywebsite/wp-admin/post.php?post=ccc&action=edit
 PHP   7. call_user_func_array:{/mywebpath/wp-includes/plugin.php:213}()
 /mywebpath/wp-includes/plugin.php:213, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit
 PHP   8. do_shortcode() /mywebpath/wp-includes/plugin.php:213, referer:
 http://mywebsite/wp-admin/post.php?post=ccc&action=edit
 PHP   9. preg_replace_callback() /mywebpath/wp-
 includes/shortcodes.php:197, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit
 PHP  10. do_shortcode_tag() /mywebpath/wp-includes/shortcodes.php:197,
 referer: http://mywebsite/wp-admin/post.php?post=ccc&action=edit
 PHP  11. call_user_func:{/mywebpath/wp-includes/shortcodes.php:286}()
 /mywebpath/wp-includes/shortcodes.php:286, referer: http://mywebsite/wp-
 admin/post.php?post=ccc&action=edit

 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31983>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list