• A new version of Full Calendar is now available.

    See the details here

Get_magic_quotes_gpc function was deprecated

peyacoc

New Member
I got this error message:

The "Call to undefined function get_magic_quotes_gpc()" error indicates that you are trying to call a function that is no longer supported in PHP. The get_magic_quotes_gpc function was deprecated in PHP 5.3.0 and removed in PHP 7.0.0.


in \plugins\fabrik_element\jdate\jdate.php

I fixed it like this:

//this works for me!!!
protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true, $container = null)
{
$default = filter_input(INPUT_POST, $v, FILTER_SANITIZE_STRING);
$htmlId = $this->getHTMLId();
$layout = $this->getLayout('list-filter-autocomplete');
$displayData = new stdClass;
$displayData->class = $this->filterClass();
$displayData->name = $v;
$displayData->default = $default;
$displayData->htmlId = $htmlId;
$autoId = '#' . $htmlId . '-auto-complete';
if (!$normal)
{
$autoId = '.advanced-search-list .autocomplete-trigger';
}
FabrikHelperHTML::autoComplete($autoId, $this->getElement()->id, $this->getFormModel()->getId(), 'date');
return $layout->render($displayData);
}
// fine codice

/* this does not work DEPRECATED
protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true, $container = null)
{
if (get_magic_quotes_gpc())
{
$default = stripslashes($default);
}
$default = htmlspecialchars($default);
$htmlId = $this->getHTMLId();
$layout = $this->getLayout('list-filter-autocomplete');
$displayData = new stdClass;
$displayData->class = $this->filterClass();
$displayData->name = $v;
$displayData->default = $default;
$displayData->htmlId = $htmlId;
$autoId = '#' . $htmlId . '-auto-complete';
if (!$normal)
{
$autoId = '.advanced-search-list .autocomplete-trigger';
}
FabrikHelperHTML::autoComplete($autoId, $this->getElement()->id, $this->getFormModel()->getId(), 'date');
return $layout->render($displayData);
}
fine codice deprecato */


//this works for me!!!
protected function hiddenFilter($default, $v)
{
if (is_array($default))
{
$default = array_shift($default);
}

$default = addslashes(htmlspecialchars($default));
$class = $this->filterClass();

// Don't add id as caused issues with inline edit plugin and clashing ids.
return '<input type="hidden" name="' . $v . '" class="' . $class . '" value="' . $default . '" />';
}
//fine codice mio
/* this does not work
protected function hiddenFilter($default, $v)
{
if (is_array($default))
{
$default = array_shift($default);
}
if (get_magic_quotes_gpc())
{
$default = stripslashes($default);
}
$default = htmlspecialchars($default);
$class = $this->filterClass();
// Don't add id as caused issues with inline edit plugin and clashing ids.
return '<input type="hidden" name="' . $v . '" class="' . $class . '" value="' . $default . '" />';
}
fine codice deprecato */
 
Are you actually getting an error that stops your application? This should just be a warning. We do all our testing and development on PHP 8.1 and do not get this halting our applications. You should be able to elliminate it by turning the Joomla debug to None.

Having said that it is probably time to remove all these call in Fabrik. I have done so in the development branch of Fabrik-4. Will be part of the next release.
 
Back
Top