Skip to content

Commit

Permalink
Merge pull request #3 from DorsetDigital/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
DorsetDigital committed Jun 12, 2018
2 parents 0f341ae + 1b33ddb commit f4a5d0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CDNMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private function updateBody(&$body, &$response)

if ($this->config()->get('add_prefetch') === true) {
$prefetchTag = $this->getPrefetchTag();
$body = str_replace('<head>', "<head>".$prefetchTag, $body);
$body = str_replace('<head>', "<head>" . $prefetchTag, $body);
if ($this->config()->get('add_debug_headers') == true) {
$response->addHeader('X-CDN-Prefetch', 'Enabled');
}
Expand Down Expand Up @@ -209,7 +209,7 @@ private function getPrefetchTag()
private function getIsAdmin(HTTPRequest $request)
{
$adminPaths = static::config()->get('admin_url_paths');
$adminPaths[] = AdminRootController::config()->get('url_base') . '/';
$adminPaths[ ] = AdminRootController::config()->get('url_base') . '/';
$currentPath = rtrim($request->getURL(), '/') . '/';
foreach ($adminPaths as $adminPath) {
if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
Expand Down

0 comments on commit f4a5d0e

Please sign in to comment.