In my installation of WPMU at fbxsquare.com, <!--more--> is removed from posts. It is stripped from the post when it is inserted into the db.
I have worked around the problem by commenting out line 23 of wp-includes/functions-post.php—//$post_content = apply_filters('content_save_pre', $post_content);
.
Is there a more elegant solution than this approach? Does anyone know what $post_content = apply_filters('content_save_pre', $post_content);
does (or is supposed to do)? Any idea why it is stripping the more comment from the post?
http://mu.wordpress.org/forums/topic/409
and there was another post for it as well that I didn't see in my quick scan through just then.
jaseone, I saw your post about filters being turned off to temporarily fix the problem, but you didn't go into any detail as to how to do that.
I posted a link to this thread in both topic 409 and topic 345.
Is this the best/only place to discuss WPMU bugs and fixes? Is there a wpmu-hackers list or something.... If not, would Matt be the one to talk to about getting that set up on automattic.com like the rest of the mailing lists?
err turning the filters off is exactly what you did already... That can be a security risk if you don't trust your bloggers or authors as it allows them to do crafty things like fake the login page to capture login details and what not.
As for places to discuss WPMU, this is it for now and I think at the moment the forums alone are adequate as there isn't really the traffic to support multiple channels of support like there is for single user Wordpress. It would be nice to get some more developer input here from time to time though. ;)
Right. I realized that I had disabled the filters. I thought it was all formatting related, though; I did not know that there were security implications as well.
So, what would be the alternative to entirely disabling filtering on $post_content
? The more link must work... Why does the filtering remove the more tag? How/why are the WPMU functions any different from WP's functions?
They really tightened the post filtering in both single user WP 1.6 and WPMU lately so I think it is a problem in both unless they fixed it recently.
I've replaced the function in question, wp_insert_post(), with the same from current stable WP 1.5.2. This seems to work.
Are there any MU-specific issues known with this approach? It appears as though there are no differences in this function between the nightlies of both apps, so replacing the MU function with the WP function shouldn't cause any problems, right?
Scratch that idea. Every time I edit a post, it creates a new post with the changes I've made. I've reverted back to the commented-line-23 option on the original wp-includes/functions-post.php. Any other ideas?
Hope that Donncha sees this and decides to takes a look at it? ;)
I found the problem. its in kses.php, in wp_kses_split2().
It has a regular expression that tries to understand HTML tags (both closing and opening) but failes to understand HTML comments which wp_kses_split() also sends to this function.
I added these lines before the preg_match:
if (preg_match('%^<!--[^>-]+-->$%', $string))
return $string; // its an HTML comment, and possibly a WP special tag. I'll allow that
And now it works. I believe this is safe.