1

In order to get the whole POST I do

$app        = JFactory::getApplication();
$jinput     = $app->input;
$data       = $jinput->getArray($_POST);

that works ok.

But I want to apply the filter JREQUEST_ALLOWHTML.

$data       = $jinput->getArray($_POST, JREQUEST_ALLOWHTML);

Does not work. I have tried several ways but at the ends the only one that works for me is:

$data       = JRequest::get( 'post', JREQUEST_ALLOWHTML );    

as JRquest is deprecated I wonder if there is another way to get the whole post in an array with JREQUEST_ALLOWHTML filter.

Thanks for your help.

2

This should be the rough equivalent. Retrieve unfiltered (raw) input and then filter it with custom filter instance:

$data = JFactory::getApplication()->input->post->getArray(array(), null, 'raw');
$data = JFilterInput::getInstance(null, null, 1, 1)->clean($data, null);

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.