mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge branch '3.3' into 3
This commit is contained in:
commit
af4b546050
@ -34,6 +34,7 @@ matrix:
|
||||
before_script:
|
||||
- composer self-update || true
|
||||
- phpenv rehash
|
||||
- phpenv config-rm xdebug.ini
|
||||
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
|
||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss; fi"
|
||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/behat-extension; fi"
|
||||
|
@ -250,7 +250,7 @@ class ErrorPage extends Page {
|
||||
// if the page is published in a language other than default language,
|
||||
// write a specific language version of the HTML page
|
||||
$filePath = self::get_filepath_for_errorcode($this->ErrorCode, $this->Locale);
|
||||
if (!file_put_contents($filePath, $errorContent)) {
|
||||
if (file_put_contents($filePath, $errorContent) === false) {
|
||||
$fileErrorText = _t(
|
||||
'ErrorPage.ERRORFILEPROBLEM',
|
||||
'Error opening file "{filename}" for writing. Please check file permissions.',
|
||||
|
@ -259,12 +259,13 @@ class SiteTreeLinkTracking_Parser {
|
||||
// Local anchor.
|
||||
$matches = array();
|
||||
if(preg_match('/^#(.*)/i', $href, $matches)) {
|
||||
$anchor = preg_quote($matches[1], '#');
|
||||
$results[] = array(
|
||||
'Type' => 'localanchor',
|
||||
'Target' => null,
|
||||
'Anchor' => $matches[1],
|
||||
'DOMReference' => $link,
|
||||
'Broken' => !preg_match("#(name|id)=\"{$matches[1]}\"#", $htmlValue->getContent())
|
||||
'Broken' => !preg_match("#(name|id)=\"{$anchor}\"#", $htmlValue->getContent())
|
||||
);
|
||||
|
||||
continue;
|
||||
|
@ -112,7 +112,7 @@ class BrokenLinksReport extends SS_Report {
|
||||
$stageLink = $item->AbsoluteLink();
|
||||
return sprintf('%s <a href="%s">%s</a>',
|
||||
$stageLink,
|
||||
$liveLink ? $liveLink : $stageLink . '?stage=Stage',
|
||||
$liveLink ? $liveLink : Controller::join_links($stageLink, '?stage=Stage'),
|
||||
$liveLink ? '(live)' : '(draft)'
|
||||
);
|
||||
}
|
||||
@ -128,8 +128,8 @@ class BrokenLinksReport extends SS_Report {
|
||||
'Draft' => _t('BrokenLinksReport.CheckSiteDropdownDraft', 'Draft Site')
|
||||
)),
|
||||
new DropdownField(
|
||||
'Reason',
|
||||
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
||||
'Reason',
|
||||
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
||||
array(
|
||||
'' => _t('BrokenLinksReport.Any', 'Any'),
|
||||
'BROKENFILE' => _t('BrokenLinksReport.ReasonDropdownBROKENFILE', 'Broken file'),
|
||||
|
@ -20,6 +20,7 @@ class SiteTreeLinkTrackingTest extends SapphireTest {
|
||||
|
||||
$this->assertFalse($this->isBroken('<a name="anchor">anchor</a>'));
|
||||
$this->assertFalse($this->isBroken('<a id="anchor">anchor</a>'));
|
||||
$this->assertTrue($this->isBroken('<a href="##anchor">anchor</a>'));
|
||||
|
||||
$page = new Page();
|
||||
$page->Content = '<a name="yes-name-anchor">name</a><a id="yes-id-anchor">id</a>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user