Closed (duplicate)
Project:
Read More Link (Drupal 6 and earlier)
Version:
6.x-5.0-rc7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Dec 2010 at 07:39 UTC
Updated:
14 Jan 2011 at 06:34 UTC
Sometimes when style is set to 'inline' preg_match() on line 212 of ed_readmore.module fails to find the closing delimiter. Adding trim() to $node->content['body']['#value'] fixes that.
So I suggest instead of
if (preg_match('!</?'. $elements .'[^>]*>$!i', $node->content['body']['#value'], $match, PREG_OFFSET_CAPTURE)) { at line 212 the following:
$trimmed = trim($node->content['body']['#value']);
if (preg_match('!</?'. $elements .'[^>]*>$!i', $trimmed, $match, PREG_OFFSET_CAPTURE)) {
or changing the regexp to accomodate possible whitespace:
'!</?'. $elements .'[^>]*\s*>$!i'
Comments
Comment #1
todd nienkerk commentedA very similar patch was committed to the dev branch a few weeks ago:
Does this appear to fix the issue?
Comment #2
geaseYes. Sorry for having overlooked the existing thread. Marking issue as duplicate then.