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
			}
@@ 3363-3379 (lines=17) @@
3360
			foreach ($properties as $prop_name => $prop) {
3361
				foreach ($prop as $prop_index => $prop_record) {
3362
					$record = array();
3363
					foreach ($prop_record as $prop_field => $prop_value) {
3364
						switch (gettype($prop_value)) {
3365
							case "integer":
3366
							case "boolean":
3367
							case "double":
3368
								$value = $prop_value;
3369
							break;
3370
							default:
3371
								$value = $prop_value;
3372
								if (substr($prop_value, 0, 1) === "'" && substr($prop_value, -1) === "'"
3373
										&& "'".AddSlashes(StripSlashes(substr($prop_value, 1, -1)))."'" == $prop_value) {
3374
									$value = stripSlashes(substr($prop_value,1,-1));
3375
									// todo add deprecated warning
3376
								}
3377
						}
3378
						$record[$prop_field] = $value;
3379
					}
3380
					$properties[$prop_name][$prop_index] = $record;
3381
				}
3382
			}