Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Sat Apr 20, 2024 2:37 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
PostPosted: Sat Feb 24, 2007 7:52 am 
Offline
Helper

Joined: Sat Sep 17, 2005 7:15 am
Posts: 71
One of my PCs has Spybot Search & Destroy 1.4 - I'm wondering if this is similar to the single quote escape issue that I listed earlier today.

The RSS page breaks with the following error:

[code]Whitespace is not allowed at this location.
Line: 392 Character: 25

<title>Spybot - Search & Destroy 1.4</title>[/code]

It appears to be because of the ampersand in the title...if I go into the database and update the title text to "Spybot - Search and Destroy 1.4", the RSS page works fine...

_________________
Server Info:
OS : Windows Server 2003
Auditing: ~300 machines
LDAP: Windows Server 2003 Active Directory


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Feb 27, 2007 7:58 am 
Offline
Helper

Joined: Sat Sep 17, 2005 7:15 am
Posts: 71
Ok, I think I've worked around this issue, but I'm sure the developers can think of a better way.

I've taken the original code:

[code]
if ($myrow = mysql_fetch_array($result)){

do {
echo '<item>'."\n";
echo '<title>'.$myrow["software_name"].'</title>'."\n";
echo '<link>'.$sitebaseurl.'system.php?pc='.$myrow["system_uuid"].'&amp;view=summary</link>'."\n";
echo '<description>Computer: '.$myrow["system_name"]. ' User: '.$myrow["net_user_name"].' IP Address: '.ip_trans($myrow["net_ip_address"]).'</description>'."\n";
echo '</item>'."\n";
} while ($myrow = mysql_fetch_array($result));
}
[/code]


and changed it to this:

[code]
if ($myrow = mysql_fetch_array($result)){

$ConvertedTitle = str_replace("&", "&#38", $myrow["software_name"]);

do {
echo '<item>'."\n";
echo '<title>'.$ConvertedTitle.'</title>'."\n";
echo '<link>'.$sitebaseurl.'system.php?pc='.$myrow["system_uuid"].'&amp;view=summary</link>'."\n";
echo '<description>Computer: '.$myrow["system_name"]. ' User: '.$myrow["net_user_name"].' IP Address: '.ip_trans($myrow["net_ip_address"]).'</description>'."\n";
echo '</item>'."\n";
} while ($myrow = mysql_fetch_array($result));
}[/code]

This seems to do the trick, although I'm not sure why...why doesn't the '&' in the ASCII &#38 still cause an issue?

_________________
Server Info:
OS : Windows Server 2003
Auditing: ~300 machines
LDAP: Windows Server 2003 Active Directory


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Feb 27, 2007 8:24 am 
[quote]Whitespace is not allowed at this location.

That would do the trick. The ampersand is often used to denote characters that are not valid otherwise (or not part of the ASCII set). There is no "& " character sequence, hence the error.

Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 28, 2007 12:50 am 
Offline
Helper

Joined: Sat Sep 17, 2005 7:15 am
Posts: 71
[quote="mikeyrb"][quote]Whitespace is not allowed at this location.

That would do the trick. The ampersand is often used to denote characters that are not valid otherwise (or not part of the ASCII set). There is no "& " character sequence, hence the error.

Ah, that makes sense. Should I keep this code then (good enough to not endanger anything)...?

Is this the only character that I should be concerned about?

Thanks Mike!

Rob

_________________
Server Info:
OS : Windows Server 2003
Auditing: ~300 machines
LDAP: Windows Server 2003 Active Directory


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 28, 2007 4:46 am 
I'll have to think about it. We have issues using the xml submit method where we have to convert UTF-8 characters, and I'm not sure if some of those might be stored using & strings. The code as written may screw that up. Hopefully we can find a way to get UTF-8 working. I'm not sure how well Dave has a fix working.


Top
  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group