[wp-trac] [WordPress Trac] #25880: wp_notify_postauthor() does not initialize the subject and content text for custom comment types

WordPress Trac noreply at wordpress.org
Sat Nov 9 03:53:25 UTC 2013


#25880: wp_notify_postauthor() does not initialize the subject and content text for
custom comment types
--------------------------+------------------------------
 Reporter:  sebet         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:
 Severity:  minor         |  Resolution:
 Keywords:                |
--------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> Unlike, ''wp_notify_moderator()'' that uses a ''switch/case()'' statement
> that defaults to comment types of type 'comment',
> ''wp_notify_moderator()'' uses an ''if/else()'', resulting in
> '$notify_message' and '$subject' undefined var notices when these vars
> are concatenated later in that same function, when using a custom comment
> type:
>
> ''Notice: Undefined variable: notify_message in ...wp-
> includes\pluggable.php on line 1076
> Notice: Undefined variable: subject in ...\wp-includes\pluggable.php on
> line 1109''
>
> This can be easily fixed by initializing the vars ($var = '') or by
> replacing the ''if/else()'' with a ''switch/case()'' that defaults to
> 'comment'.

New description:

 Unlike `wp_notify_moderator()`, that uses a `switch/case()` statement that
 defaults to comment types of type 'comment', `wp_notify_postauthor()` uses
 an `if/else()`, resulting in `$notify_message` and `$subject` undefined
 var notices when these vars are concatenated later in that same function,
 when using a custom comment type:
 {{{
 Notice: Undefined variable: notify_message in ...wp-includes\pluggable.php
 on line 1076
 Notice: Undefined variable: subject in ...\wp-includes\pluggable.php on
 line 1109
 }}}
 This can be easily fixed by initializing the vars (`$var = ''`) or by
 replacing the `if/else()` with a `switch/case()` that defaults to
 'comment'.

--

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25880#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list