1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
hunk ./lib/action.php 2
-/*
+/**
hunk ./lib/action.php 20
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('LACONICA')) {
+ exit(1);
+}
hunk ./lib/action.php 24
-class Action { // lawsuit
+class Action // lawsuit
+{
hunk ./lib/action.php 27
- var $args;
+ var $args;
hunk ./lib/action.php 29
- function Action() {
- }
+ function Action()
+ {
+ }
hunk ./lib/action.php 33
- # For initializing members of the class
+ // For initializing members of the class
hunk ./lib/action.php 35
- function prepare($argarray) {
- $this->args =& common_copy_args($argarray);
- return true;
- }
+ function prepare($argarray)
+ {
+ $this->args =& common_copy_args($argarray);
+ return true;
+ }
hunk ./lib/action.php 41
- # For comparison with If-Last-Modified
- # If not applicable, return NULL
+ // For comparison with If-Last-Modified
+ // If not applicable, return null
hunk ./lib/action.php 44
- function last_modified() {
- return NULL;
- }
+ function last_modified()
+ {
+ return null;
+ }
hunk ./lib/action.php 49
- function etag() {
- return NULL;
- }
+ function etag()
+ {
+ return null;
+ }
hunk ./lib/action.php 54
- function is_readonly() {
- return false;
- }
+ function is_readonly()
+ {
+ return false;
+ }
hunk ./lib/action.php 59
- function arg($key, $def=NULL) {
- if (array_key_exists($key, $this->args)) {
- return $this->args[$key];
- } else {
- return $def;
- }
- }
+ function arg($key, $def=null)
+ {
+ if (array_key_exists($key, $this->args)) {
+ return $this->args[$key];
+ } else {
+ return $def;
+ }
+ }
hunk ./lib/action.php 68
- function trimmed($key, $def=NULL) {
- $arg = $this->arg($key, $def);
- return (is_string($arg)) ? trim($arg) : $arg;
- }
+ function trimmed($key, $def=null)
+ {
+ $arg = $this->arg($key, $def);
+ return (is_string($arg)) ? trim($arg) : $arg;
+ }
hunk ./lib/action.php 74
- # Note: argarray ignored, since it's now passed in in prepare()
+ // Note: argarray ignored, since it's now passed in in prepare()
hunk ./lib/action.php 76
- function handle($argarray=NULL) {
+ function handle($argarray=null)
+ {
hunk ./lib/action.php 79
- $lm = $this->last_modified();
- $etag = $this->etag();
+ $lm = $this->last_modified();
+ $etag = $this->etag();
hunk ./lib/action.php 82
- if ($etag) {
- header('ETag: ' . $etag);
- }
+ if ($etag) {
+ header('ETag: ' . $etag);
+ }
hunk ./lib/action.php 86
- if ($lm) {
- header('Last-Modified: ' . date(DATE_RFC1123, $lm));
- $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
- if ($if_modified_since) {
- $ims = strtotime($if_modified_since);
- if ($lm <= $ims) {
- if (!$etag || $this->_has_etag($etag, $_SERVER['HTTP_IF_NONE_MATCH'])) {
- header('HTTP/1.1 304 Not Modified');
- # Better way to do this?
- exit(0);
- }
- }
- }
- }
- }
+ if ($lm) {
+ header('Last-Modified: ' . date(DATE_RFC1123, $lm));
+ $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
+ if ($if_modified_since) {
+ $ims = strtotime($if_modified_since);
+ if ($lm <= $ims) {
+ if (!$etag ||
+ $this->_has_etag($etag, $_SERVER['HTTP_IF_NONE_MATCH'])) {
+ header('HTTP/1.1 304 Not Modified');
+ // Better way to do this?
+ exit(0);
+ }
+ }
+ }
+ }
+ }
hunk ./lib/action.php 103
- function _has_etag($etag, $if_none_match) {
- return ($if_none_match) && in_array($etag, explode(',', $if_none_match));
- }
+ function _has_etag($etag, $if_none_match)
+ {
+ return ($if_none_match) && in_array($etag, explode(',', $if_none_match));
+ }
hunk ./lib/action.php 108
- function boolean($key, $def=false) {
- $arg = strtolower($this->trimmed($key));
+ function boolean($key, $def=false)
+ {
+ $arg = strtolower($this->trimmed($key));
hunk ./lib/action.php 112
- if (is_null($arg)) {
- return $def;
- } else if (in_array($arg, array('true', 'yes', '1'))) {
- return true;
- } else if (in_array($arg, array('false', 'no', '0'))) {
- return false;
- } else {
- return $def;
- }
- }
+ if (is_null($arg)) {
+ return $def;
+ } else if (in_array($arg, array('true', 'yes', '1'))) {
+ return true;
+ } else if (in_array($arg, array('false', 'no', '0'))) {
+ return false;
+ } else {
+ return $def;
+ }
+ }
hunk ./lib/action.php 123
- function server_error($msg, $code=500) {
- $action = $this->trimmed('action');
- common_debug("Server error '$code' on '$action': $msg", __FILE__);
- common_server_error($msg, $code);
- }
+ function server_error($msg, $code=500)
+ {
+ $action = $this->trimmed('action');
+ common_debug("Server error '$code' on '$action': $msg", __FILE__);
+ common_server_error($msg, $code);
+ }
hunk ./lib/action.php 130
- function client_error($msg, $code=400) {
- $action = $this->trimmed('action');
- common_debug("User error '$code' on '$action': $msg", __FILE__);
- common_user_error($msg, $code);
- }
+ function client_error($msg, $code=400)
+ {
+ $action = $this->trimmed('action');
+ common_debug("User error '$code' on '$action': $msg", __FILE__);
+ common_user_error($msg, $code);
+ }
hunk ./lib/action.php 137
- function self_url() {
- $action = $this->trimmed('action');
- $args = $this->args;
- unset($args['action']);
- foreach (array_keys($_COOKIE) as $cookie) {
- unset($args[$cookie]);
- }
- return common_local_url($action, $args);
- }
+ function self_url()
+ {
+ $action = $this->trimmed('action');
+ $args = $this->args;
+ unset($args['action']);
+ foreach (array_keys($_COOKIE) as $cookie) {
+ unset($args[$cookie]);
+ }
+ return common_local_url($action, $args);
+ }
hunk ./lib/action.php 148
- function nav_menu($menu) {
+ function nav_menu($menu)
+ {
hunk ./lib/action.php 153
- common_menu_item(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : NULL),
- $menudesc[0],
- $menudesc[1],
- $action == $menuaction);
+ common_menu_item(common_local_url($menuaction,
+ isset($menudesc[2]) ? $menudesc[2] : null),
+ $menudesc[0],
+ $menudesc[1],
+ $action == $menuaction);
hunk ./lib/action.php 160
- }
+ }
|