Site:Developer stuff/Fix rss titles

From Feast upon the Word (http://feastupontheword.org). Copyright, Feast upon the Word.
< Site:Developer stuff
Revision as of 08:33, 19 March 2007 by 67.166.97.61 (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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];
     }