Code Duplication    Length = 13-14 lines in 2 locations

mod/solr_api/start.php 2 locations

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