I have one string value such as The string contains double spaces. I am fetching this string as:

$string = $jinput->get('sports', '','raw');

It returns me correct result when there are no double spaces in a string. But, if there is a double space as above example, it omits the double space and gives: The string contains double spaces

I want to get the string value as it is. Any idea how can I get this?


This is weird. raw simply returns the value of the field with no filtering whatsoever (see libraries/joomla/filter/input.php). However, it might be that there is some other filtering done before or after your code. Check to see if $_GET['sports'] has the same problem, if it does, then it is likely caused by a server setting somewhere. If it doesn't, then the culprit is either the Joomla core or a Joomla plugin.

You can always use $_GET to retrieve your values, but make sure you do the proper filtering on the values retrieved in order to prevent an attack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.