Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added http headers for 404 and 500 error views, also added 403 to cro…

…n.php script.
  • Loading branch information...
commit 92ee344058fa5a44d7e392686dfe6823004b2919 1 parent 008b537
@geekforbrains authored
Showing with 11 additions and 1 deletion.
  1. +8 −1 core/view/view.php
  2. +3 −0  cron.php
View
9 core/view/view.php
@@ -105,7 +105,14 @@ public static function getBaseHref()
*
* @param int $code The error code to display
*/
- public static function error($code) {
+ public static function error($code)
+ {
+ if($code == ERROR_404)
+ header('HTTP/1.1 404 Not Found');
+
+ elseif($code == ERROR_500)
+ header('HTTP/1.1 500 Internal Server Error');
+
self::$_error = self::getPath() . 'errors/' . $code . EXT;
}
View
3  cron.php
@@ -14,7 +14,10 @@
* Dont allow cron to be run via the browser, it must be run from CLI
*/
if(isset($_SERVER['HTTP_HOST']))
+{
+ header('HTTP/1.1 403 Forbidden');
exit(1);
+}
if(!isset($argv[1]) || !strlen(PASSCODE) || PASSCODE !== $argv[1])
exit("Missing or invalid pass code.\n");
Please sign in to comment.
Something went wrong with that request. Please try again.