There are currently a number of problems with _twitter_filter_text():

  1. Usernames in tweets like
    Eloquent Toronto singer/songwriter Jadea Kelly (@JadeaKelly) is rolling...

    are not replaced with links;

  2. When constructing the regexp, $prefix should be run through preg_quote();
  3. Multiple regexps can easily be replaced with one that has a lookbehind zero-width assertion.

The attached patch fixes the above issues.

Comments

damienmckenna’s picture

Issue summary: View changes
Status: Needs review » Needs work

Triggering the testbot.

damienmckenna’s picture

Status: Needs work » Needs review

Triggering the testbot.

damienmckenna’s picture

StatusFileSize
new1 KB

Rerolled.

damienmckenna’s picture

StatusFileSize
new1 KB

For 7.x-6.x.

damienmckenna’s picture

StatusFileSize
new1008 bytes

For 6.x-5.x.

The last submitted patch, 3: twitter-n1993470-3-7.x-5.x.patch, failed testing.

The last submitted patch, 4: twitter-n1993470-4-7.x-6.x.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: twitter-n1993470-5-6.x-5.x.patch, failed testing.

damienmckenna’s picture

damienmckenna’s picture

Version: 7.x-6.x-dev » 7.x-5.x-dev

damienmckenna’s picture

damienmckenna’s picture

Version: 7.x-5.x-dev » 6.x-5.x-dev

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed d2621a0 on 7.x-5.x authored by jamix
    Issue #1993470 by jamix, DamienMcKenna: Improved _twitter_filter_text().
    

  • DamienMcKenna committed 86aadff on authored by jamix
    Issue #1993470 by jamix, DamienMcKenna: Improved _twitter_filter_text().
    
jamix’s picture

Thanks!

  • DamienMcKenna committed 6c981f1 on 7.x-6.x authored by jamix
    Issue #1993470 by jamix, DamienMcKenna: Improved _twitter_filter_text().
    

Status: Fixed » Closed (fixed)

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