سؤال

I'm trying to purify link parameter, and it contains something like:

http://test.com/?id=1&lang=en

but when I pass this link to HTMLPurifier it returns it like:

http://test.com/?id=1〈=en

So a question: is there a way to prevent HTMLPurifier to represent &lang like entity?

هل كانت مفيدة؟

المحلول

The correct format would be to replace the ampersand with the correct entity:

http://test.com/?id=1&lang=en

نصائح أخرى

simply replace your & with &amp ;

$url=http://test.com/?id=1&lang=en;
$url=str_replace('&', '&', $url);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top