Difference between revisions of "Site:Developer stuff/Fix rss titles"
From Feast upon the Word (http://feastupontheword.org). Copyright, Feast upon the Word.
(initial content) |
(edit / by Matthew posting w/out logging in (as a test)) |
||
| Line 1: | Line 1: | ||
| + | The following seems to be working for now, but obviously it will mess up either if there is the word by in the user name or in the title. I haven't tested which one is going to cause the problem but my guess it is the user name--i.e. that the regular matching expression will prefer the last "by". | ||
| + | |||
if (preg_match("/^Comment on(.*)by(.*)/", $title, $matches)) { | if (preg_match("/^Comment on(.*)by(.*)/", $title, $matches)) { | ||
$title = $matches[2]." on ".$matches[1]; | $title = $matches[2]." on ".$matches[1]; | ||
} | } | ||
Latest revision as of 08:33, 19 March 2007
The following seems to be working for now, but obviously it will mess up either if there is the word by in the user name or in the title. I haven't tested which one is going to cause the problem but my guess it is the user name--i.e. that the regular matching expression will prefer the last "by".
if (preg_match("/^Comment on(.*)by(.*)/", $title, $matches)) {
$title = $matches[2]." on ".$matches[1];
}