mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 04:53:26 +00:00
use unserialize method of serchEngineOption object instead of json_decode
This commit is contained in:
@@ -102,11 +102,17 @@ class Tooltip implements ControllerProviderInterface
|
||||
$record = new \record_adapter($sbas_id, $record_id, $number);
|
||||
|
||||
$search_engine = null;
|
||||
if (($search_engine_options = unserialize($app['request']->get('options_serial'))) !== false)
|
||||
$option = new \searchEngine_options();
|
||||
$options_serial = $app['request']->get('options_serial');
|
||||
|
||||
if ($options_serial)
|
||||
{
|
||||
if (($search_engine_options = $option->unserialize($app['request']->get('options_serial'))) !== false)
|
||||
{
|
||||
$search_engine = new \searchEngine_adapter($app['appbox']->get_registry());
|
||||
$search_engine->set_options($search_engine_options);
|
||||
}
|
||||
}
|
||||
|
||||
/* @var $twig \Twig_Environment */
|
||||
$twig = $app['Core']->getTwig();
|
||||
@@ -163,8 +169,6 @@ class Tooltip implements ControllerProviderInterface
|
||||
|
||||
$controllers->post('/metas/DCESInfos/{sbas_id}/{field_id}/'
|
||||
, function(Application $app, $sbas_id, $field_id)
|
||||
{
|
||||
try
|
||||
{
|
||||
$databox = \databox::get_instance((int) $sbas_id);
|
||||
$field = \databox_field::get_instance($databox, $field_id);
|
||||
@@ -178,11 +182,6 @@ class Tooltip implements ControllerProviderInterface
|
||||
, array('field' => $field)
|
||||
)
|
||||
);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
exit($e->getMessage());
|
||||
}
|
||||
})->assert('sbas_id', '\d+')->assert('field_id', '\d+');
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user