Plugin Directory

Changeset 149551


Ignore:
Timestamp:
08/27/2009 08:12:19 AM (16 years ago)
Author:
RickGC
Message:

1.9.8 regexp bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • twitter-for-wordpress/trunk/twitter.php

    r133806 r149551  
    33/*
    44Plugin Name: Twitter for Wordpress
    5 Version: 1.9.6
     5Version: 1.9.7
    66Plugin URI: http://rick.jinlabs.com/code/twitter
    77Description: Displays your public Twitter messages for all to read. Based on <a href="http://cavemonkey50.com/code/pownce/">Pownce for Wordpress</a> by <a href="http://cavemonkey50.com/">Cavemonkey50</a>.
     
    113113
    114114function hyperlinks($text) {
    115     // Props to Allen Shaw
     115    // Props to Allen Shaw & webmancers.com
    116116    // match protocol://address/path/file.extension?some=variable&another=asf%
    117     $text = preg_replace("/\b([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)\b/i","<a href=\"$1\" class=\"twitter-link\">$1</a>", $text);
     117    //$text = preg_replace("/\b([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)\b/i","<a href=\"$1\" class=\"twitter-link\">$1</a>", $text);
     118    $text = preg_replace('/\b([a-zA-Z]+:\/\/[\w_.\-]+\.[a-zA-Z]{2,6}[\/\w\-~.?=&%#+$*!]*)\b/i',"<a href=\"$1\" class=\"twitter-link\">$1</a>", $text);
    118119    // match www.something.domain/path/file.extension?some=variable&another=asf%
    119     $text = preg_replace("/\b(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)\b/i","<a href=\"http://$1\" class=\"twitter-link\">$1</a>", $text);
     120    //$text = preg_replace("/\b(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)\b/i","<a href=\"http://$1\" class=\"twitter-link\">$1</a>", $text);
     121    $text = preg_replace('/\b(?<!:\/\/)(www\.[\w_.\-]+\.[a-zA-Z]{2,6}[\/\w\-~.?=&%#+$*!]*)\b/i',"<a href=\"http://$1\" class=\"twitter-link\">$1</a>", $text);   
     122   
    120123    // match name@address
    121124    $text = preg_replace("/\b([a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]*\@[a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]{2,6})\b/i","<a href=\"mailto://$1\" class=\"twitter-link\">$1</a>", $text);
Note: See TracChangeset for help on using the changeset viewer.