|
@@ 1469-1477 (lines=9) @@
|
| 1466 |
|
# URLs, per RFC 2396. |
| 1467 |
|
# Make terminate a URL as well (bug T84937) |
| 1468 |
|
$m2 = []; |
| 1469 |
|
if ( preg_match( |
| 1470 |
|
'/&(lt|gt|nbsp|#x0*(3[CcEe]|[Aa]0)|#0*(60|62|160));/', |
| 1471 |
|
$url, |
| 1472 |
|
$m2, |
| 1473 |
|
PREG_OFFSET_CAPTURE |
| 1474 |
|
) ) { |
| 1475 |
|
$trail = substr( $url, $m2[0][1] ) . $trail; |
| 1476 |
|
$url = substr( $url, 0, $m2[0][1] ); |
| 1477 |
|
} |
| 1478 |
|
|
| 1479 |
|
# Move trailing punctuation to $trail |
| 1480 |
|
$sep = ',;\.:!?'; |
|
@@ 1779-1782 (lines=4) @@
|
| 1776 |
|
# removeHTMLtags()) should not be included in |
| 1777 |
|
# URLs, per RFC 2396. |
| 1778 |
|
$m2 = []; |
| 1779 |
|
if ( preg_match( '/&(lt|gt);/', $url, $m2, PREG_OFFSET_CAPTURE ) ) { |
| 1780 |
|
$text = substr( $url, $m2[0][1] ) . ' ' . $text; |
| 1781 |
|
$url = substr( $url, 0, $m2[0][1] ); |
| 1782 |
|
} |
| 1783 |
|
|
| 1784 |
|
# If the link text is an image URL, replace it with an <img> tag |
| 1785 |
|
# This happened by accident in the original parser, but some people used it extensively |