See the commit log from
http://drupal.org/cvs?commit=81456

Probabaly just a little regex goofiness.

Comments

dww’s picture

theme_cvs_commit_message() is the droid you're looking for:

function theme_cvs_commit_message($commit) {
  $commit->message = preg_replace('/((?:(?:fix|add|patch)(?:ed)?\s+#?|#)(\d+))/ie', "strtr('<a href=\"$commit->trackerurl\">\\1</a>', array('%d' => '\\2'))", htmlspecialchars($commit->message));
  $commit->files = cvs_files($commit);
  ...

Ahh, nothing like having serious regexp magic in your theme function... ;)

hunmonk’s picture

Title: 'add 32' of '(and add 32x32)' interpreted as a link to node 32 » regex in theme_cvs_commit_message() adds erroneous links
Status: Active » Fixed

should be all fixed up, deployed on d.o

jpetso’s picture

Status: Fixed » Active

The fix is incorrect, because it makes the whole first part of the regex ("added/patched/fixed N") obsolete. That was a way to make issue references without hash signs possible, and now doesn't work anymore - which is, for the record, a good thing imho (yay for simplicity). So if it's decided that a hash sign is needed in all cases then this part can be deleted altogether. That would make the regexp look like /#(\d+)/i, and that's quite a bit simpler indeed :D

I could also imagine another possibility: (?:(?:fix|add|patch)(?:ed)?\s+#?|#)(\d+)\b/i - note the \b at the end, which indicates a word boundary. That would fix the "add 32x32" issue at hand... don't know how far we want to go in allowing stuff, though. Just decide on something, and I'll do it the same way in Commit Log.

jpetso’s picture

Oh right, and of course we could also use a combination of \b and the simple no-frills regexp. That would actually be my preferred choice.

hunmonk’s picture

Status: Active » Postponed (maintainer needs more info)

@jpetso: if you give me the exact regex to use for your suggestion in #4, then i'll be happy to commit that.

jpetso’s picture

Status: Postponed (maintainer needs more info) » Active

@jpetso: if you give me the exact regex to use for your suggestion in #4, then i'll be happy to commit that.

Sure, that would be /#(\d+)\b/i.
Tested and works on #300: blah, Fix #300 by jpetso: blah, #300- your lucky numbah.
Does not work (by design) on Fix 300: blah and similar stuff without hash signs.

hunmonk’s picture

Status: Active » Fixed

looks like we actually needed /#(\d+)\b/ie for the backreferences to work, and i needed to clean up the backreferences in the strtr(). tested, and works well. committed to 5.x and 6.x, deployed on d.o.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.