Code Duplication    Length = 13-14 lines in 2 locations

mod/solr_api/start.php 2 locations

@@ 313-326 (lines=14) @@
310
	foreach ($entities as $entity) {
311
312
313
		if (is_Json($entity->title)) {
314
			$title_array = json_decode($entity->title, true);
315
			if (!isset($title_array['en']) || !isset($title_array['fr'])) {
316
				$title_array['en'] = str_replace('"', '\"', $title_array);
317
				$title_array['fr'] = str_replace('"', '\"', $title_array);
318
			} else {
319
				$title_array['en'] = str_replace('"', '\"', gc_explode_translation($entity->title, 'en'));
320
				$title_array['fr'] = str_replace('"', '\"', gc_explode_translation($entity->title, 'fr'));
321
			}
322
323
		} else {
324
			$title_array['en'] = $entity->title;
325
			$title_array['fr'] = $entity->title;
326
		}
327
328
		if (is_Json($entity->description)) {
329
			$description_array = json_decode($entity->description, true);
@@ 328-340 (lines=13) @@
325
			$title_array['fr'] = $entity->title;
326
		}
327
328
		if (is_Json($entity->description)) {
329
			$description_array = json_decode($entity->description, true);
330
			if (!isset($description_array['en']) || !isset($description_array['fr'])) {
331
				$description_array['en'] = str_replace('"', '\"', $description_array);
332
				$description_array['fr'] = str_replace('"', '\"', $description_array);
333
			} else {
334
				$description_array['en'] = str_replace('"', '\"', gc_explode_translation($entity->description, 'en'));
335
				$description_array['fr'] = str_replace('"', '\"', gc_explode_translation($entity->description, 'fr'));
336
			}
337
		} else {
338
			$description_array['en'] = $entity->description;
339
			$description_array['fr'] = $entity->description;
340
		}
341
342
		$arr[] = array(
343
			'guid' => $entity->getGUID(),