Code Duplication    Length = 19-19 lines in 2 locations

class/todatauri.php 2 locations

@@ 294-312 (lines=19) @@
291
			foreach ($ar_regex as $regex) {
292
				//$ar = $this->Match('/(<style[^<]+url\(\s*(\S+)\s*\)[^<]+<\/style>)/i', $src);
293
				$ar = $this->Match($regex, $src);
294
				if (!empty($ar)) {
295
					// Do as multi match
296
					if (!is_array($ar[0])) {
297
						$ar1 = array(0=>$ar);
298
						$ar = $ar1;
299
						unset($ar1);
300
					}
301
					// Begin loop
302
					foreach ($ar as $val) {
303
						$s = $this->ParseUrl($val[1]);
304
						if (!empty($s)) {
305
							// Use whole match to do str_replace, because url can be used multi times.
306
							$s = str_replace($val[1], $s, $val[0]);
307
							$src = str_replace($val[0], $s, $src);
308
						}
309
					}
310
					// Write result to dom
311
					$item->nodeValue = $src;
312
				}
313
			}
314
		}
315
@@ 335-353 (lines=19) @@
332
				$regex = "/(url\s*\(['\"]?\s*([^'\"]+)['\"]?\s*\))/i";
333
334
				$ar = $this->Match($regex, $src);
335
				if (!empty($ar)) {
336
					// Do as multi match
337
					if (!is_array($ar[0])) {
338
						$ar1 = array(0=>$ar);
339
						$ar = $ar1;
340
						unset($ar1);
341
					}
342
					// Begin loop
343
					foreach ($ar as $val) {
344
						$s = $this->ParseUrl($val[1]);
345
						if (!empty($s)) {
346
							// Use whole match to do str_replace, because url can be used multi times.
347
							$s = str_replace($val[1], $s, $val[0]);
348
							$src = str_replace($val[0], $s, $src);
349
						}
350
					}
351
					// Write result to dom
352
					$item->setAttribute('style', $src);
353
				}
354
			}
355
		}
356
		/*