Code Duplication    Length = 12-12 lines in 2 locations

core/src/Core.php 2 locations

@@ 404-415 (lines=12) @@
401
     * Redirect to the error page, by calling sendForward(). This is called for example when the page was not found.
402
     * @param bool $noEvent
403
     */
404
    public function sendErrorPage($noEvent = false)
405
    {
406
        $this->systemCacheKey = 'notfound';
407
        if (!$noEvent) {
408
            // invoke OnPageNotFound event
409
            $this->invokeEvent('OnPageNotFound');
410
        }
411
        $url = UrlProcessor::getNotFoundPageId();
412
413
        $this->sendForward($url, 'HTTP/1.0 404 Not Found');
414
        exit();
415
    }
416
417
    /**
418
     * @param bool $noEvent
@@ 420-431 (lines=12) @@
417
    /**
418
     * @param bool $noEvent
419
     */
420
    public function sendUnauthorizedPage($noEvent = false)
421
    {
422
        // invoke OnPageUnauthorized event
423
        $_REQUEST['refurl'] = $this->documentIdentifier;
424
        $this->systemCacheKey = 'unauth';
425
        if (!$noEvent) {
426
            $this->invokeEvent('OnPageUnauthorized');
427
        }
428
429
        $this->sendForward(UrlProcessor::getUnAuthorizedPageId(), 'HTTP/1.1 401 Unauthorized');
430
        exit();
431
    }
432
433
    /**
434
     * Returns the document identifier of the current request