HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Live Lookup error - ajax_gateway.php 353


#1

I’m no longer able to do a livelookup to AD users. I get this error message in the logs:

EntityRef: expecting ‘;’ ajax_gateway.php 353

What can I check?


#2

It’s hard to say exactly, but it looks like you have an invalid character in your XML. So the parser is breaking because an character entity which should be escaped isn’t being escaped. My guess is that perhaps there’s a new user which has an apostrophe or ampersand in their name or something like that. You should call htmlspecialchars() on each record you output to make sure apostrophes are escaped. For example:

foreach($customers->result() AS $cust){
	echo'
	<customer>	
			<customer_id>'.htmlspecialchars($cust->id).'</customer_id>
			<first_name>'.htmlspecialchars($cust->fname).'</first_name>
			<last_name>'.htmlspecialchars($cust->lname).'</last_name>
			<email>'.htmlspecialchars($cust->email).'</email>
			<phone>'.htmlspecialchars($cust->phone).'</phone>
	</customer>';
}

It could also be an illegal character for that character set. So if Live Lookup is setup to receive iso-8859-1 and you’re sending back a character not in that character set that could be a problem as well.