1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author Andreas Fischer <[email protected]> |
4
|
|
|
* @author Christopher Schäpers <[email protected]> |
5
|
|
|
* @author Frank Karlitschek <[email protected]> |
6
|
|
|
* @author Joas Schilling <[email protected]> |
7
|
|
|
* @author Jörn Friedrich Dreyer <[email protected]> |
8
|
|
|
* @author Kristof Provost <[email protected]> |
9
|
|
|
* @author Lukas Reschke <[email protected]> |
10
|
|
|
* @author [email protected] <[email protected]> |
11
|
|
|
* @author Masaki Kawabata Neto <[email protected]> |
12
|
|
|
* @author Morris Jobke <[email protected]> |
13
|
|
|
* @author Philipp Schaffrath <[email protected]> |
14
|
|
|
* @author Thomas Müller <[email protected]> |
15
|
|
|
* |
16
|
|
|
* @copyright Copyright (c) 2018, ownCloud GmbH |
17
|
|
|
* @license AGPL-3.0 |
18
|
|
|
* |
19
|
|
|
* This code is free software: you can redistribute it and/or modify |
20
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
21
|
|
|
* as published by the Free Software Foundation. |
22
|
|
|
* |
23
|
|
|
* This program is distributed in the hope that it will be useful, |
24
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
25
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26
|
|
|
* GNU Affero General Public License for more details. |
27
|
|
|
* |
28
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
29
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
30
|
|
|
* |
31
|
|
|
*/ |
32
|
|
|
|
33
|
|
|
try { |
34
|
|
|
require_once __DIR__ . '/lib/base.php'; |
35
|
|
|
|
36
|
|
|
# show the version details based on config.php parameter, |
37
|
|
|
# but do not expose the servername in the public via url |
38
|
|
|
$values = \OCP\Util::getStatusInfo( |
39
|
|
|
null, |
|
|
|
|
40
|
|
|
\OC::$server->getConfig()->getSystemValue('show_server_hostname', false) !== true); |
41
|
|
|
|
42
|
|
|
if (OC::$CLI) { |
43
|
|
|
\print_r($values); |
44
|
|
|
} else { |
45
|
|
|
\header('Access-Control-Allow-Origin: *'); |
46
|
|
|
\header('Content-Type: application/json'); |
47
|
|
|
echo \json_encode($values); |
48
|
|
|
} |
49
|
|
|
} catch (Exception $ex) { |
50
|
|
|
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
51
|
|
|
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
52
|
|
|
} |
53
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: