Since my provider upgraded to php 5.2 I notice that
_filter_autop('') -> returns </p> and not an empty string or <p></p>
Fixed it for now by putting this on top of _filter_autop
if ($text === "") {
return $text;
}
This was especially visible with the image module since all images have an empty body on my site...
it generated
<img src="someimageurl" alt="xxx" title="xxx" class="image preview" width="413" height="550" /></p>
which is invalid html
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | _filter_autop.patch | 1.19 KB | yched |
Comments
Comment #1
bwynants commentedInstalled PHP 5.2 on my computer
same issue...
I'm not that familiar with reg exps so I leave this for the experts...
definetly not happening before 5.2
Comment #2
bwynants commentedsame seems to happen on drupal 5
this is the cck output for an empty field.....
Comment #3
ChristopherFritz commentedI just wanted to add, I had the same issue (while using Taxonomy context). The given solution [if ($text === "") { return $text; } ] works like a charm (thanks!)
This is a real problem for those using XHTML (application/xhtml+xml), and it appears to be an easy solution.
$Id: filter.module,v 1.160 2007/01/12 07:27:21 unconed Exp $
Comment #4
yched commentedThis should be a better fix - there is a mistake in one of the regexps in _filter_autop
Moving to Drupal 6, since this should be fixed here first, then backported.
The patch is for D6, but should apply to D5 (with an offset).
Comment #5
bwynants commentedseems to be working just fine. Thx!
Comment #6
dries commentedCommitted to CVS HEAD.
Comment #7
bryan kennedy commentedThis is an issue in the latest version of 4.7 as well. At least for me.
Comment #8
drummCommitted to 5.x;
Comment #9
killes@www.drop.org commentedapplied
Comment #10
(not verified) commented