Added
Link Here
|
1 |
diff -ur endpoints/api.php.orig endpoints/api.php |
2 |
--- endpoints/api.php.orig |
3 |
+++ endpoints/api.php |
4 |
@@ -334,6 +334,9 @@ |
5 |
|
6 |
// Just append to $vbox->errors and let it get |
7 |
// taken care of below |
8 |
+ if(!isset($vbox)) { |
9 |
+ $vbox = new stdClass(); |
10 |
+ } |
11 |
if(!$vbox || !$vbox->errors) { |
12 |
$vbox->errors = array(); |
13 |
} |
14 |
@@ -342,7 +345,7 @@ |
15 |
|
16 |
|
17 |
// Add any messages |
18 |
-if($vbox && count($vbox->messages)) { |
19 |
+if($vbox && isset($vbox->messages)?count($vbox->messages):false) { |
20 |
foreach($vbox->messages as $m) |
21 |
$response['messages'][] = 'vboxconnector('.$request['fn'] .'): ' . $m; |
22 |
} |
23 |
@@ -360,7 +363,7 @@ |
24 |
if($e->getCode() == vboxconnector::PHPVB_ERRNO_CONNECT && isset($vbox->settings)) |
25 |
$d .= "\n\nLocation:" . $vbox->settings->location; |
26 |
|
27 |
- $response['messages'][] = htmlentities($e->getMessage()).' ' . htmlentities($details); |
28 |
+ $response['messages'][] = htmlentities($e->getMessage()). htmlentities(' '. $details); |
29 |
|
30 |
$response['errors'][] = array( |
31 |
'error'=> ($e->getCode() & vboxconnector::PHPVB_ERRNO_HTML ? $e->getMessage() : htmlentities($e->getMessage())), |
32 |
diff -ur endpoints/jqueryFileTree.php.orig endpoints/jqueryFileTree.php |
33 |
--- endpoints/jqueryFileTree.php.orig |
34 |
+++ endpoints/jqueryFileTree.php |
35 |
@@ -223,6 +223,8 @@ |
36 |
*/ |
37 |
function getdir($dir, $dirsOnly=false, $recurse=array()) { |
38 |
|
39 |
+ global $allowed_exts; |
40 |
+ |
41 |
if(!$dir) $dir = DSEP; |
42 |
|
43 |
$entries = getDirEntries($dir, $dirsOnly); |
44 |
@@ -251,9 +253,9 @@ |
45 |
// Push file on to stack |
46 |
} else { |
47 |
|
48 |
- $ext = strtolower(preg_replace('/^.*\./', '', $file)); |
49 |
+ $ext = strtolower(preg_replace('/^.*\./', '', $path)); |
50 |
|
51 |
- if(count($allowed) && !$allowed['.'.$ext]) continue; |
52 |
+ if(count($allowed_exts) && !$allowed_exts['.'.$ext]) continue; |
53 |
|
54 |
array_push($dirents, file_entry($path)); |
55 |
} |
56 |
diff -ur endpoints/lib/language.php.orig endpoints/lib/language.php |
57 |
--- endpoints/lib/language.php.orig |
58 |
+++ endpoints/lib/language.php |
59 |
@@ -73,6 +73,8 @@ |
60 |
$xmlObj = simplexml_load_string(@file_get_contents(VBOX_BASE_LANG_DIR.'/'.$lang.'.xml')); |
61 |
$arrXml = $this->objectsIntoArray($xmlObj); |
62 |
|
63 |
+ if(!array_key_exists('context',$arrXml)) return; |
64 |
+ |
65 |
$lang = array(); |
66 |
if(!@$arrXml['context'][0]) $arrXml['context'] = array($arrXml['context']); |
67 |
foreach($arrXml['context'] as $c) { |
68 |
diff -ur endpoints/lib/vboxServiceWrappers.php.orig endpoints/lib/vboxServiceWrappers.php |
69 |
--- endpoints/lib/vboxServiceWrappers.php.orig |
70 |
+++ endpoints/lib/vboxServiceWrappers.php |
71 |
@@ -108,7 +108,7 @@ |
72 |
} |
73 |
|
74 |
/** ArrayAccess Functions **/ |
75 |
- public function offsetSet($offset, $value) |
76 |
+ public function offsetSet($offset, $value): void |
77 |
{ |
78 |
if ($value instanceof $this->_interfaceName) |
79 |
{ |
80 |
@@ -127,49 +127,50 @@ |
81 |
} |
82 |
} |
83 |
|
84 |
- public function offsetExists($offset) |
85 |
+ public function offsetExists($offset): bool |
86 |
{ |
87 |
return isset($this->_objects[$offset]); |
88 |
} |
89 |
|
90 |
- public function offsetUnset($offset) |
91 |
+ public function offsetUnset($offset): void |
92 |
{ |
93 |
unset($this->_objects[$offset]); |
94 |
} |
95 |
|
96 |
- public function offsetGet($offset) |
97 |
+ public function offsetGet($offset): mixed |
98 |
{ |
99 |
return isset($this->_objects[$offset]) ? $this->_objects[$offset] : null; |
100 |
} |
101 |
|
102 |
/** Iterator Functions **/ |
103 |
- public function rewind() |
104 |
+ public function rewind(): void |
105 |
{ |
106 |
reset($this->_objects); |
107 |
} |
108 |
|
109 |
- public function current() |
110 |
+ public function current(): mixed |
111 |
{ |
112 |
return current($this->_objects); |
113 |
} |
114 |
|
115 |
- public function key() |
116 |
+ public function key(): mixed |
117 |
{ |
118 |
return key($this->_objects); |
119 |
} |
120 |
|
121 |
+ #[\ReturnTypeWillChange] |
122 |
public function next() |
123 |
{ |
124 |
return next($this->_objects); |
125 |
} |
126 |
|
127 |
- public function valid() |
128 |
+ public function valid(): bool |
129 |
{ |
130 |
return ($this->current() !== false); |
131 |
} |
132 |
|
133 |
/** Countable Functions **/ |
134 |
- public function count() |
135 |
+ public function count(): int |
136 |
{ |
137 |
return count($this->_objects); |
138 |
} |
139 |
diff -ur endpoints/screen.php.orig endpoints/screen.php |
140 |
--- endpoints/screen.php.orig |
141 |
+++ endpoints/screen.php |
142 |
@@ -87,13 +87,13 @@ |
143 |
|
144 |
// Let the browser cache images for 3 seconds |
145 |
$ctime = 0; |
146 |
- if(strpos($_SERVER['HTTP_IF_NONE_MATCH'],'_')) { |
147 |
+ if(strpos($_SERVER['HTTP_IF_NONE_MATCH'] ?? '','_')) { |
148 |
$ctime = preg_replace("/.*_/",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH'])); |
149 |
- } else if(strpos($_ENV['HTTP_IF_NONE_MATCH'],'_')) { |
150 |
+ } else if(strpos($_ENV['HTTP_IF_NONE_MATCH'] ?? '','_')) { |
151 |
$ctime = preg_replace("/.*_/",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH'])); |
152 |
- } else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'],'GMT')) { |
153 |
+ } else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'] ?? '','GMT')) { |
154 |
$ctime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']); |
155 |
- } else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'],'GMT')) { |
156 |
+ } else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'] ?? '','GMT')) { |
157 |
$ctime = strtotime($_ENV['HTTP_IF_MODIFIED_SINCE']); |
158 |
} |
159 |
|
160 |
diff -ur panes/settingsDisplay.html.orig panes/settingsDisplay.html |
161 |
--- panes/settingsDisplay.html.orig |
162 |
+++ panes/settingsDisplay.html |
163 |
@@ -68,9 +68,9 @@ |
164 |
<th><span class='translate'>Authentication Method:</span></th> |
165 |
<td> |
166 |
<select name='vboxSettingsDisplayVRDEAuth' id='vboxSettingsDisplayVRDEAuthID' style='width: 100%'> |
167 |
- <option value='' >None</option> |
168 |
- <option value='External'>External</option> |
169 |
- <option value='Guest'>Guest</option> |
170 |
+ <option value='Null'>None</option> |
171 |
+ <option value='External'>External</option> |
172 |
+ <option value='Guest'>Guest</option> |
173 |
</select> |
174 |
</td> |
175 |
</tr> |
176 |
diff -ur panes/settingsNetwork.html.orig panes/settingsNetwork.html |
177 |
--- panes/settingsNetwork.html.orig |
178 |
+++ panes/settingsNetwork.html |
179 |
@@ -320,7 +320,7 @@ |
180 |
} |
181 |
|
182 |
// Special case for Internal, Generic, and VDE network selects |
183 |
- if(sel.value == 'Internal' || sel.value == 'VDE' || sel.value == 'Generic' || sel.value == 'Bridged') { |
184 |
+ if(sel.value == 'Internal' || sel.value == 'VDE' || sel.value == 'Generic') { |
185 |
$(nsel).jec(); |
186 |
} |
187 |
|