PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Wiki_BBCode » Bug #5767

relative [url] syntax not supported (e.g. [url=/contact.php])

Details

Request #5767relative [url] syntax not supported (e.g. [url=/contact.php])
Submitted2005-10-24 14:57 UTC
Fromme at ben-xo dot com
Assignedtoggg
StatusClosed
PackageText_Wiki_BBCode
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2005-10-24 14:57 UTC] me at ben-xo dot com

Description:
------------
You already support other "bad" syntaxes such as [url=www...] and [url=ftp...] via a configurationo in BBCode/Url.php. Here's one I use on some of my sites.

You would probably want to make it configurable.

Test script:
---------------
--- Text_Wiki_BBCode-0.0.1/Text/Wiki/Parse/BBCode/Url.php 2005-08-11 11:23:50.000000000 +0100
+++ Text_Wiki_BBCode-0.0.1-benxo/Text/Wiki/Parse/BBCode/Url.php 2005-10-24 15:53:11.000000000 +0100
@@ -98,6 +98,7 @@
foreach ($prefixes as $val) {
$url .= '|' . preg_quote($val, '#') . '\.';
}
+ $url .= '|/';
$host = $this->getConf('host_regexp', $default['host_regexp']);
// the full url regexp
$url .= ')' . $host . $this->getConf('path_regexp', $default['path_regexp']);