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