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
			}
@@ 3374-3390 (lines=17) @@
3371
			foreach ($properties as $prop_name => $prop) {
3372
				foreach ($prop as $prop_index => $prop_record) {
3373
					$record = array();
3374
					foreach ($prop_record as $prop_field => $prop_value) {
3375
						switch (gettype($prop_value)) {
3376
							case "integer":
3377
							case "boolean":
3378
							case "double":
3379
								$value = $prop_value;
3380
							break;
3381
							default:
3382
								$value = $prop_value;
3383
								if (substr($prop_value, 0, 1) === "'" && substr($prop_value, -1) === "'"
3384
										&& "'".AddSlashes(StripSlashes(substr($prop_value, 1, -1)))."'" == $prop_value) {
3385
									$value = stripSlashes(substr($prop_value,1,-1));
3386
									// todo add deprecated warning
3387
								}
3388
						}
3389
						$record[$prop_field] = $value;
3390
					}
3391
					$properties[$prop_name][$prop_index] = $record;
3392
				}
3393
			}