Opened 15 years ago
Closed 15 years ago
#12078 closed defect (bug) (fixed)
Warning : in_array Invalid argument in wp-includes/post.php on line 1997
Reported by: | firebird75 | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9.1 |
Component: | Permalinks | Keywords: | has-patch commit dev-reviewed |
Focuses: | Cc: |
Description
Hello,
I am receiving a warning while publishing a new post through the post by email feature.
The warning states that the second argument is invalid in wp-includes/post.php on line 1997.
Here is the code :
in_array($slug, $wp_rewrite->feeds) ) { |
If I modify this line to this :
in_array($slug, $feeds) ) { |
Then the warning goes away. I am not sure however about the implications around this change.
Please note that you may not see this error by using the post by email feature as I am reusing the code as part of the plugin to allow custom post types submission by email but the code is the same, it is just the way I call it that is different. Instead of requiring the direct call to wp-mail.php, I have created a function which contains the code of wp-mail.php as part of my plugin.
The plugin in question is WATS (wordpress advanced ticket system).
The problem can be reproduced with any kind of email received (plain text, html, etc...).
Looking through the rest of the code the change looks correct without any implications. Above that:
And a bunch of
$post_name_check || in_array($slug, $feeds)
between that line and this as well.Patch forthcoming.