| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/admin/includes/modules/brickfox/lib/ |
Upload File : |
<?php
/* --------------------------------------------------------------
$Id: DOMDocument.php 0.1 2011-07-16 $
brickfox Multichannel eCommerce
http://www.brickfox.de
Copyright (c) 2011 brickfox by NETFORMIC GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
-------------------------------------------------------------- */
class Brickfox_Lib_DOMDocument extends DOMDocument
{
/**
* createElement()
*
* Create a DOMNode
* Encode to UTF-8
* Replace XML-invalid chars
* Check for invalid strings
*
* @param String $name Name of the Node
* @param String $value Value to attach to the Node
* @return DOMNode
*/
public function createElement($name, $value = null)
{
if ($value) {
$value = utf8_encode($value);
$value = str_replace('&', '&', $value);
$value = str_replace('<', '<', $value);
$value = str_replace('>', '>', $value);
if (!@simplexml_load_string('<data>' . $value . '</data>')) {
$value = '';
}
}
$domElement = new Brickfox_Lib_DOMElement($name, $value);
$documentFragment = $this->createDocumentFragment();
$documentFragment->appendChild($domElement);
return $documentFragment->removeChild($domElement);
}
/**
* createElement()
*
* Create a DOMCDATASection
* Encode to UTF-8
*
* @param String $name Name of the Node
* @return DOMCDATASection
*/
public function createCDATASection($data)
{
$data = utf8_encode($data);
return parent::createCDATASection($data);
}
}
?>