@@ -10,7 +10,7 @@ |
||
10 | 10 | ************************************************************************************/ |
11 | 11 | |
12 | 12 | if (!file_exists('framework') || !file_exists('framework/_config.php')) { |
13 | - include "install-frameworkmissing.html"; |
|
13 | + include "install-frameworkmissing.html"; |
|
14 | 14 | } else { |
15 | - include('./framework/src/Dev/Install/install.php'); |
|
15 | + include('./framework/src/Dev/Install/install.php'); |
|
16 | 16 | } |
@@ -24,29 +24,29 @@ discard block |
||
24 | 24 | |
25 | 25 | // IIS will populate server variables using one of these two ways |
26 | 26 | if ($isIIS) { |
27 | - if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { |
|
28 | - $url = ""; |
|
29 | - } else { |
|
30 | - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
31 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
32 | - $url = strtok($url, '?'); |
|
33 | - } else { |
|
34 | - $url = $_SERVER['REQUEST_URI']; |
|
35 | - if ($url[0] == '/') { |
|
36 | - $url = substr($url, 1); |
|
37 | - } |
|
38 | - $url = strtok($url, '?'); |
|
39 | - } |
|
40 | - } |
|
27 | + if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { |
|
28 | + $url = ""; |
|
29 | + } else { |
|
30 | + if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
31 | + $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
32 | + $url = strtok($url, '?'); |
|
33 | + } else { |
|
34 | + $url = $_SERVER['REQUEST_URI']; |
|
35 | + if ($url[0] == '/') { |
|
36 | + $url = substr($url, 1); |
|
37 | + } |
|
38 | + $url = strtok($url, '?'); |
|
39 | + } |
|
40 | + } |
|
41 | 41 | |
42 | 42 | // Apache will populate the server variables this way |
43 | 43 | } else { |
44 | - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
45 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
46 | - $url = strtok($url, '?'); |
|
47 | - } else { |
|
48 | - $url = ""; |
|
49 | - } |
|
44 | + if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
45 | + $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
46 | + $url = strtok($url, '?'); |
|
47 | + } else { |
|
48 | + $url = ""; |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $_GET['url'] = $_REQUEST['url'] = $url; |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | * Very quickly pass through references to files |
59 | 59 | */ |
60 | 60 | if ($url && file_exists($fileName)) { |
61 | - $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url; |
|
62 | - if (isset($_SERVER['QUERY_STRING'])) { |
|
63 | - $fileURL .= '?' . $_SERVER['QUERY_STRING']; |
|
64 | - } |
|
65 | - header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); |
|
66 | - header("Location: $fileURL"); |
|
67 | - die(); |
|
61 | + $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url; |
|
62 | + if (isset($_SERVER['QUERY_STRING'])) { |
|
63 | + $fileURL .= '?' . $_SERVER['QUERY_STRING']; |
|
64 | + } |
|
65 | + header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); |
|
66 | + header("Location: $fileURL"); |
|
67 | + die(); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | require_once('framework/main.php'); |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { |
28 | 28 | $url = ""; |
29 | 29 | } else { |
30 | - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
31 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
30 | + if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen+1) == ($_SERVER['SCRIPT_NAME'].'/')) { |
|
31 | + $url = substr($_SERVER['REQUEST_URI'], $snLen+1); |
|
32 | 32 | $url = strtok($url, '?'); |
33 | 33 | } else { |
34 | 34 | $url = $_SERVER['REQUEST_URI']; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | // Apache will populate the server variables this way |
43 | 43 | } else { |
44 | - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
45 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
44 | + if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen+1) == ($_SERVER['SCRIPT_NAME'].'/')) { |
|
45 | + $url = substr($_SERVER['REQUEST_URI'], $snLen+1); |
|
46 | 46 | $url = strtok($url, '?'); |
47 | 47 | } else { |
48 | 48 | $url = ""; |
@@ -51,18 +51,18 @@ discard block |
||
51 | 51 | |
52 | 52 | $_GET['url'] = $_REQUEST['url'] = $url; |
53 | 53 | |
54 | -$fileName = dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $url; |
|
54 | +$fileName = dirname($_SERVER['SCRIPT_FILENAME']).'/'.$url; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * This code is a very simple wrapper for sending files |
58 | 58 | * Very quickly pass through references to files |
59 | 59 | */ |
60 | 60 | if ($url && file_exists($fileName)) { |
61 | - $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url; |
|
61 | + $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])).'/'.$url; |
|
62 | 62 | if (isset($_SERVER['QUERY_STRING'])) { |
63 | - $fileURL .= '?' . $_SERVER['QUERY_STRING']; |
|
63 | + $fileURL .= '?'.$_SERVER['QUERY_STRING']; |
|
64 | 64 | } |
65 | - header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); |
|
65 | + header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently'); |
|
66 | 66 | header("Location: $fileURL"); |
67 | 67 | die(); |
68 | 68 | } |
@@ -4,29 +4,29 @@ |
||
4 | 4 | |
5 | 5 | class PageController extends ContentController |
6 | 6 | { |
7 | - /** |
|
8 | - * An array of actions that can be accessed via a request. Each array element should be an action name, and the |
|
9 | - * permissions or conditions required to allow the user to access it. |
|
10 | - * |
|
11 | - * <code> |
|
12 | - * array ( |
|
13 | - * 'action', // anyone can access this action |
|
14 | - * 'action' => true, // same as above |
|
15 | - * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action |
|
16 | - * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true |
|
17 | - * ); |
|
18 | - * </code> |
|
19 | - * |
|
20 | - * @var array |
|
21 | - */ |
|
22 | - private static $allowed_actions = array( |
|
7 | + /** |
|
8 | + * An array of actions that can be accessed via a request. Each array element should be an action name, and the |
|
9 | + * permissions or conditions required to allow the user to access it. |
|
10 | + * |
|
11 | + * <code> |
|
12 | + * array ( |
|
13 | + * 'action', // anyone can access this action |
|
14 | + * 'action' => true, // same as above |
|
15 | + * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action |
|
16 | + * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true |
|
17 | + * ); |
|
18 | + * </code> |
|
19 | + * |
|
20 | + * @var array |
|
21 | + */ |
|
22 | + private static $allowed_actions = array( |
|
23 | 23 | |
24 | - ); |
|
24 | + ); |
|
25 | 25 | |
26 | - protected function init() |
|
27 | - { |
|
28 | - parent::init(); |
|
29 | - // You can include any CSS or JS required by your project here. |
|
30 | - // See: https://docs.silverstripe.org/en/developer_guides/templates/requirements/ |
|
31 | - } |
|
26 | + protected function init() |
|
27 | + { |
|
28 | + parent::init(); |
|
29 | + // You can include any CSS or JS required by your project here. |
|
30 | + // See: https://docs.silverstripe.org/en/developer_guides/templates/requirements/ |
|
31 | + } |
|
32 | 32 | } |
@@ -4,11 +4,11 @@ |
||
4 | 4 | |
5 | 5 | class Page extends SiteTree |
6 | 6 | { |
7 | - private static $db = array( |
|
7 | + private static $db = array( |
|
8 | 8 | |
9 | - ); |
|
9 | + ); |
|
10 | 10 | |
11 | - private static $has_one = array( |
|
11 | + private static $has_one = array( |
|
12 | 12 | |
13 | - ); |
|
13 | + ); |
|
14 | 14 | } |