Code Duplication    Length = 17-20 lines in 2 locations

lib/objects/ariadne_object.php 2 locations

@@ 319-338 (lines=20) @@
316
					unset($properties[$wf_prop_name][$wf_prop_index]);
317
				} else {
318
					$record = array();
319
					foreach ($wf_prop_record as $wf_prop_field => $wf_prop_value) {
320
						switch (gettype($wf_prop_value)) {
321
							case "integer":
322
							case "boolean":
323
							case "double":
324
								$value = $wf_prop_value;
325
								break;
326
							default:
327
								$value = $wf_prop_value;
328
								// backwards compatibility, store will do the escaping from now on
329
								// will be removed in the future
330
								if (substr($wf_prop_value, 0, 1) === "'" && substr($wf_prop_value, -1) === "'"
331
										&& "'".AddSlashes(StripSlashes(substr($wf_prop_value, 1, -1)))."'" == $wf_prop_value) {
332
									$value = stripSlashes(substr($wf_prop_value,1,-1));
333
									// todo add deprecated warning
334
								}
335
336
						}
337
						$record[$wf_prop_field] = $value;
338
					}
339
					$properties[$wf_prop_name][] = $record;
340
				}
341
			}
@@ 3372-3388 (lines=17) @@
3369
			foreach ($properties as $prop_name => $prop) {
3370
				foreach ($prop as $prop_index => $prop_record) {
3371
					$record = array();
3372
					foreach ($prop_record as $prop_field => $prop_value) {
3373
						switch (gettype($prop_value)) {
3374
							case "integer":
3375
							case "boolean":
3376
							case "double":
3377
								$value = $prop_value;
3378
							break;
3379
							default:
3380
								$value = $prop_value;
3381
								if (substr($prop_value, 0, 1) === "'" && substr($prop_value, -1) === "'"
3382
										&& "'".AddSlashes(StripSlashes(substr($prop_value, 1, -1)))."'" == $prop_value) {
3383
									$value = stripSlashes(substr($prop_value,1,-1));
3384
									// todo add deprecated warning
3385
								}
3386
						}
3387
						$record[$prop_field] = $value;
3388
					}
3389
					$properties[$prop_name][$prop_index] = $record;
3390
				}
3391
			}