FIX: API links should be urlencoded() to prevent special characters causing issues

This commit is contained in:
Will Rossiter 2014-09-27 19:46:39 +12:00
parent 508238a7b2
commit f706a9d8a2
4 changed files with 11 additions and 9 deletions

View File

@ -298,9 +298,9 @@ class DocumentationParser {
$url = sprintf(
self::$api_link_base,
$subject,
$page->getVersion(),
$page->getEntity()->getKey()
urlencode($subject),
urlencode($page->getVersion()),
urlencode($page->getEntity()->getKey())
);
$md = str_replace(
@ -325,9 +325,9 @@ class DocumentationParser {
$subject = $links[1][$i];
$url = sprintf(
self::$api_link_base,
$subject,
$page->getVersion(),
$page->getEntity()->getKey()
urlencode($subject),
urlencode($page->getVersion()),
urlencode($page->getEntity()->getKey())
);
$md = str_replace(

View File

@ -475,7 +475,7 @@ html {
.documentation_children li {
float: left;
width: 33%;
margin: 0;
margin: 0 0 40px;
padding: 0 3% 0 0;
list-style: none;
}

View File

@ -221,11 +221,13 @@ pre {
pre code {
background: none;
font-weight: normal;
padding: 0;
}
code {
font: 13px/15px Monaco, 'Bitstream Vera Sans Mono', Courier, monospace;
background: #dff1ff;
background: #fffde8;
padding: 2px;
}
code a {
color: #4E5661;

View File

@ -321,7 +321,7 @@ HTML;
$result
);
$this->assertContains(
'[DataObject::$has_one](http://api.silverstripe.org/search/lookup/?q=DataObject::$has_one&version=2.4&module=documentationparsertest)',
'[DataObject::$has_one](http://api.silverstripe.org/search/lookup/?q=DataObject%3A%3A%24has_one&version=2.4&module=documentationparsertest)',
$result
);
}