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
			}
@@ 3308-3324 (lines=17) @@
3305
			foreach ($properties as $prop_name => $prop) {
3306
				foreach ($prop as $prop_index => $prop_record) {
3307
					$record = array();
3308
					foreach ($prop_record as $prop_field => $prop_value) {
3309
						switch (gettype($prop_value)) {
3310
							case "integer":
3311
							case "boolean":
3312
							case "double":
3313
								$value = $prop_value;
3314
							break;
3315
							default:
3316
								$value = $prop_value;
3317
								if (substr($prop_value, 0, 1) === "'" && substr($prop_value, -1) === "'"
3318
										&& "'".AddSlashes(StripSlashes(substr($prop_value, 1, -1)))."'" == $prop_value) {
3319
									$value = stripSlashes(substr($prop_value,1,-1));
3320
									// todo add deprecated warning
3321
								}
3322
						}
3323
						$record[$prop_field] = $value;
3324
					}
3325
					$properties[$prop_name][$prop_index] = $record;
3326
				}
3327
			}