Encode &amps; in api links.

This commit is contained in:
Will Rossiter 2014-09-28 14:35:58 +13:00
parent dfaa28950a
commit 6edaebab41

View File

@ -15,7 +15,7 @@ class DocumentationParser {
/** /**
* @var string Rewriting of api links in the format "[api:MyClass]" or "[api:MyClass::$my_property]". * @var string Rewriting of api links in the format "[api:MyClass]" or "[api:MyClass::$my_property]".
*/ */
public static $api_link_base = 'http://api.silverstripe.org/search/lookup/?q=%s&version=%s&module=%s'; public static $api_link_base = 'http://api.silverstripe.org/search/lookup/?q=%s&version=%s&module=%s';
/** /**
* @var array * @var array
@ -305,7 +305,7 @@ class DocumentationParser {
$md = str_replace( $md = str_replace(
$match, $match,
sprintf('<code>[%s](%s)</code>', $title, $url), sprintf('[%s](%s)', $title, $url),
$md $md
); );
} }
@ -325,14 +325,14 @@ class DocumentationParser {
$subject = $links[1][$i]; $subject = $links[1][$i];
$url = sprintf( $url = sprintf(
self::$api_link_base, self::$api_link_base,
urlencode($subject), $subject,
urlencode($page->getVersion()), $page->getVersion(),
urlencode($page->getEntity()->getKey()) $page->getEntity()->getKey()
); );
$md = str_replace( $md = str_replace(
$match, $match,
sprintf('<code>[%s](%s)</code>', $subject, $url), sprintf('[%s](%s)', $subject, $url),
$md $md
); );
} }