public function __construct($wsdl, array $options = null) { $xml_security = new XML_Security(); $xml_security->enableExternalLoadOfEntities(); parent::__construct($wsdl, $options); $xml_security->disableExternalLoadOfEntities(); }
public function importFromFile(Tracker $tracker, $xml_file_path) { $xml_security = new XML_Security(); $xml = $xml_security->loadFile($xml_file_path); $xml_file_path = ""; $this->importFromXML($tracker, $xml, $xml_file_path); }
public function importFromFile(Tracker $tracker, $xml_file_path) { $xml_security = new XML_Security(); $xml = $xml_security->loadFile($xml_file_path); $xml_file_path = ""; $xml_field_mapping = new TrackerXmlFieldsMapping_InSamePlatform(); $this->importFromXML($tracker, $xml, $xml_file_path, $xml_field_mapping); }
public function tearDown() { $this->xml_security->disableExternalLoadOfEntities(); unset($GLOBALS['sys_incdir']); unset($GLOBALS['sys_custom_incdir']); unset($GLOBALS['Language']); parent::tearDown(); }
public function tearDown() { $this->xml_security->disableExternalLoadOfEntities(); foreach ($_SESSION as $key => $nop) { unset($_SESSION[$key]); } parent::tearDown(); }
private function loadXML() { $xml_security = new XML_Security(); $xml_security->disableExternalLoadOfEntities(); $xml = simplexml_load_string($this->bad_xml); $xml_security->enableExternalLoadOfEntities(); return $xml; }
public function __construct($wsdl_url, $login, $password) { $this->temporary_directory = tempnam(ForgeConfig::get('tmp_dir'), 'docmanv1-docmanv2-'); $this->wsdl_url = $wsdl_url; $this->user_login = $login; $this->user_password = $password; $xml_security = new XML_Security(); $xml_security->enableExternalLoadOfEntities(); }
public function validate(SimpleXMLElement $xml_element, $rng_path) { $dom = $this->simpleXmlElementToDomDocument($xml_element); $xml_security = new XML_Security(); $xml_security->enableExternalLoadOfEntities(); $is_valid = @$dom->relaxNGValidate($rng_path); $xml_security->disableExternalLoadOfEntities(); if (!$is_valid) { $this->extractErrors($dom, $rng_path); } }
/** * Output a html view of the given wsdl * * @param string $wsdl_uri https://example.com/plugins/statistics/soap/?wsdl */ public function render($wsdl_uri) { $xml_security = new XML_Security(); $xml_security->enableExternalLoadOfEntities(); $proc = new XSLTProcessor(); $xslDoc = new DOMDocument(); $xslDoc->load(ForgeConfig::get('codendi_dir') . "/src/www/soap/wsdl-viewer.xsl"); $proc->importStylesheet($xslDoc); $xmlDoc = new DOMDocument(); $xmlDoc->loadXML(file_get_contents($wsdl_uri)); echo $proc->transformToXML($xmlDoc); $xml_security->disableExternalLoadOfEntities(); }
public function load_conf($conf_xml_file) { if (!file_exists($conf_xml_file)) { throw new Exception("Unable to load configuration file {$conf_xml_file}.", 3017); } $xml_security = new XML_Security(); $xml = $xml_security->loadFile($conf_xml_file); if (!$xml) { throw new Exception("Unable to load configuration file {$conf_xml_file}.", 3017); } else { $this->server = "" . $xml->server["name"]; $this->server_dns = "" . $xml->server->server_uri; $this->server_port = "" . $xml->server->server_port; $this->webadmin_unsec_port = "" . $xml->webadmin->unsecure_port; $this->webadmin_sec_port = "" . $xml->webadmin->secure_port; $this->username = "" . $xml->auth->username; $this->user_pwd = "" . $xml->auth->user_pwd; $this->lockmuc_pwd = "" . $xml->auth->lockmuc_pwd; $this->helga_bot = "" . $xml->helga->helga_bot; $this->helga_service = "" . $xml->helga->helga_service; $this->group_mng_active = "" . $xml->group_mng->active; } }
ForgeConfig::loadFromFile($local_inc); ForgeConfig::loadFromFile($GLOBALS['db_config_file']); if (isset($GLOBALS['DEBUG_MODE'])) { ForgeConfig::loadFromFile($GLOBALS['codendi_dir'] . '/src/etc/development.inc.dist'); ForgeConfig::loadFromFile(dirname($local_inc) . '/development.inc'); } ForgeConfig::loadFromDatabase(); // Fix path if needed if (isset($GLOBALS['htmlpurifier_dir'])) { ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $GLOBALS['htmlpurifier_dir']); } if (isset($GLOBALS['jpgraph_dir'])) { ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $GLOBALS['jpgraph_dir']); } define('TTF_DIR', isset($GLOBALS['ttf_font_dir']) ? $GLOBALS['ttf_font_dir'] : '/usr/share/fonts/'); $xml_security = new XML_Security(); $xml_security->disableExternalLoadOfEntities(); // Detect whether this file is called by a script running in cli mode, or in normal web mode if (!defined('IS_SCRIPT')) { if (php_sapi_name() == "cli") { // Backend scripts should never ends because of lack of time or memory ini_set('max_execution_time', 0); ini_set('memory_limit', -1); define('IS_SCRIPT', true); } else { define('IS_SCRIPT', false); } } if (!IS_SCRIPT) { // Protection against clickjacking header('X-Frame-Options: SAMEORIGIN');
/** * * @param type $group_id * @param type $filepath * @param type $name * @param type $description * @param type $item_name * * @throws TrackerFromXmlException * @return Tracker */ public function createFromXMLFileWithInfo($group_id, $filepath, $name, $description, $item_name) { $xml_security = new XML_Security(); $tracker_xml = $xml_security->loadFile($filepath); if ($tracker_xml) { return $this->createFromXML($tracker_xml, $group_id, $name, $description, $item_name); } }
private function exportTV3Data($tv3_id) { $this->logger->info('--> Export TV3 data '); $xml_path = $this->generateTemporaryPath(); $indent_xsl_path = $this->getIndentXSLResourcePath(); $xml = new DOMDocument("1.0", "UTF8"); $dao = new ArtifactXMLExporterDao(); $node_helper = new ArtifactXMLNodeHelper($xml); $attachment_exporter = new ArtifactAttachmentXMLLinker($node_helper, $dao); $exporter = new ArtifactXMLExporter($dao, $attachment_exporter, $node_helper, $this->logger); $exporter->exportTrackerData($tv3_id); $this->logger->info('<-- TV3 data exported ' . PHP_EOL); $xml_security = new XML_Security(); $xml_security->enableExternalLoadOfEntities(); $xsl = new DOMDocument(); $xsl->load($indent_xsl_path); $proc = new XSLTProcessor(); $proc->importStyleSheet($xsl); $xml_string = $proc->transformToXML($xml); $xml_security->disableExternalLoadOfEntities(); if (file_put_contents($xml_path, $xml_string) !== strlen($xml_string)) { throw new Exception('Something went wrong when writing tv3 xml in ' . $xml_path); } return $xml_path; }
public function tearDown() { $this->xml_security->disableExternalLoadOfEntities(); parent::tearDown(); }
public function tearDown() { PermissionsManager::clearInstance(); $this->xml_security->disableExternalLoadOfEntities(); parent::tearDown(); }
/* * Copyright (c) Enalean, 2011. All Rights Reserved. * * This file is a part of Tuleap. * * Tuleap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Tuleap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Tuleap. If not, see <http://www.gnu.org/licenses/>. */ require_once 'common/autoload.php'; if ($files = glob('*.xml')) { echo '<ul>'; foreach ($files as $filename) { $xml_security = new XML_Security(); $xml = $xml_security->loadFile($filename); echo '<li><p>'; echo '<strong><a href="' . $filename . '">' . $xml->name . '</a></strong><br/>'; echo '' . $xml->description . '</p>'; echo '</li>'; } echo '</ul>'; }
public function tearDown() { unset($GLOBALS['Language']); $this->xml_security->disableExternalLoadOfEntities(); parent::tearDown(); }