* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
- Adding SM2 panel [SME: 13004] - Upgrade to phpsysinfo 3.4.4 - Add code to delete inline styles and add css to make it look better. - version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
/**
|
||||
* generate the xml
|
||||
*
|
||||
@@ -9,51 +8,43 @@ header('Access-Control-Allow-Origin: *');
|
||||
* @package PSI_XML
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
|
||||
* @version SVN: $Id: xml.php 614 2012-07-28 09:02:59Z jacky672 $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
/**
|
||||
* application root path
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('APP_ROOT', dirname(__FILE__));
|
||||
define('PSI_APP_ROOT', dirname(__FILE__));
|
||||
|
||||
/**
|
||||
* internal xml or external
|
||||
* external is needed when running in static mode
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
define('PSI_INTERNAL_XML', true);
|
||||
require_once PSI_APP_ROOT.'/includes/autoloader.inc.php';
|
||||
|
||||
require_once APP_ROOT.'/includes/autoloader.inc.php';
|
||||
|
||||
// check what xml part should be generated
|
||||
if (isset($_GET['plugin'])) {
|
||||
$plugin = basename(htmlspecialchars($_GET['plugin']));
|
||||
if ($plugin == "complete") {
|
||||
$output = new WebpageXML(true, null);
|
||||
} elseif ($plugin != "") {
|
||||
$output = new WebpageXML(false, $plugin);
|
||||
} else {
|
||||
unset($output);
|
||||
}
|
||||
if ((isset($_GET['json']) || isset($_GET['jsonp'])) && !extension_loaded("json")) {
|
||||
echo '<Error Message="The json extension to php required!" Function="ERROR"/>';
|
||||
} else {
|
||||
$output = new WebpageXML(false, null);
|
||||
}
|
||||
// if $output is correct generate output in proper type
|
||||
if (isset($output) && is_object($output)) {
|
||||
// check what xml part should be generated
|
||||
if (isset($_GET['plugin'])) {
|
||||
$output = new WebpageXML($_GET['plugin']);
|
||||
} else {
|
||||
$output = new WebpageXML();
|
||||
}
|
||||
// generate output in proper type
|
||||
if (isset($_GET['json']) || isset($_GET['jsonp'])) {
|
||||
if (defined('PSI_JSON_ISSUE') && (PSI_JSON_ISSUE)) {
|
||||
$json = json_encode(simplexml_load_string(str_replace(">", ">\n", $output->getXMLString()))); // solving json_encode issue
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
$json = $output->getJsonString();
|
||||
if (isset($_GET['jsonp'])) {
|
||||
header('Content-Type: application/javascript');
|
||||
echo !preg_match('/[^\w\?]/', $_GET['callback'])?$_GET['callback']:'';
|
||||
echo '('.$json.')';
|
||||
} else {
|
||||
$json = json_encode(simplexml_load_string($output->getXMLString()));
|
||||
header('Content-Type: application/json');
|
||||
echo $json;
|
||||
}
|
||||
// check for jsonp with callback name restriction
|
||||
echo isset($_GET['jsonp']) ? (!preg_match('/[^A-Za-z0-9_\?]/', $_GET['callback'])?$_GET['callback']:'') . '('.$json.')' : $json;
|
||||
} else {
|
||||
$output->run();
|
||||
}
|
||||
|
Reference in New Issue
Block a user