Skip to content

Commit

Permalink
fix #5 - manage ampersand in XML
Browse files Browse the repository at this point in the history
  • Loading branch information
flegastelois committed Jul 17, 2015
1 parent 7bfbddf commit c6eb200
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions inc/sccmxml.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ class PluginSccmSccmxml {
var $username;

function PluginSccmSccmxml($data) {

$plug = new Plugin();
$plug->getFromDBbyDir("sccm");

$this->data = $data;
$this->device_id = $data['MD-SystemName']."_".$data['CSD-MachineID'];
$this->agentbuildnumber = "SCCM-v1";
$this->agentbuildnumber = "SCCM-v".$plug->fields['version'];

$SXML=<<<XML
<?xml version='1.0' encoding='UTF-8'?>
Expand Down Expand Up @@ -184,7 +188,15 @@ function setSoftwares() {
$CONTENT->addChild('SOFTWARES');
$SOFTWARES = $this->sxml->CONTENT[0]->SOFTWARES[$i];

$SOFTWARES->addChild('NAME' ,$value['ArPd-DisplayName']);
if (preg_match("#&#", $value['ArPd-DisplayName']) ) {
$value['ArPd-DisplayName'] = preg_replace("#&#","&amp;", $value['ArPd-DisplayName']);
}

if (preg_match("#&#", $value['ArPd-Publisher']) ) {
$value['ArPd-Publisher'] = preg_replace("#&#","&amp;", $value['ArPd-Publisher']);
}

$SOFTWARES->addChild('NAME' ,$value['ArPd-DisplayName']);

if(isset($value['ArPd-Version'])) {
$SOFTWARES->addChild('VERSION' ,$value['ArPd-Version']);
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function plugin_init_sccm() {

function plugin_version_sccm() {

return array('name' => __("Interface - SCCM", "sccm"),
return array('name' => __("Interface - SCCM", "sccm"),
'version' => '0.85-1.0Beta1',
'author' => 'TECLIB\'',
'license' => 'GPLv2+',
Expand Down

0 comments on commit c6eb200

Please sign in to comment.