Code Duplication    Length = 25-25 lines in 2 locations

lib/ar/content/html.php 1 location

@@ 404-428 (lines=25) @@
401
			return new ar_content_htmlContent( htmlcleaner::cleanup( $html, $cleanAR ) );
402
		}
403
404
		private static function pregError( $errno ) {
405
			switch($errno) {
406
				case PREG_NO_ERROR:
407
					$result = 'There is no error.';
408
					break;
409
				case PREG_INTERNAL_ERROR:
410
					$result = 'There is an internal error!';
411
					break;
412
				case PREG_BACKTRACK_LIMIT_ERROR:
413
					$result = 'Backtrack limit was exhausted!';
414
					break;
415
				case PREG_RECURSION_LIMIT_ERROR:
416
					$result = 'Recursion limit was exhausted!';
417
					break;
418
				case PREG_BAD_UTF8_ERROR:
419
					$result = 'Bad UTF8 error!';
420
					break;
421
				case PREG_BAD_UTF8_OFFSET_ERROR:
422
					$result = 'Bad UTF8 offset error!';
423
					break;
424
				default:
425
					$result = 'Unknown preg errno '.$errno;
426
			}
427
			return $result;
428
		}
429
	}
430
431
	class ar_content_htmlContent extends arBase {

lib/modules/mod_page.php 1 location

@@ 40-64 (lines=25) @@
37
38
class page {
39
40
	private function pregError( $errno ) {
41
		switch($errno) {
42
			case PREG_NO_ERROR:
43
				$result = 'There is no error.';
44
				break;
45
			case PREG_INTERNAL_ERROR:
46
				$result = 'There is an internal error!';
47
				break;
48
			case PREG_BACKTRACK_LIMIT_ERROR:
49
				$result = 'Backtrack limit was exhausted!';
50
				break;
51
			case PREG_RECURSION_LIMIT_ERROR:
52
				$result = 'Recursion limit was exhausted!';
53
				break;
54
			case PREG_BAD_UTF8_ERROR:
55
				$result = 'Bad UTF8 error!';
56
				break;
57
			case PREG_BAD_UTF8_OFFSET_ERROR:
58
				$result = 'Bad UTF8 offset error!';
59
				break;
60
			default:
61
				$result = 'Unknown preg errno '.$errno;
62
		}
63
		return $result;
64
	}
65
66
	public static function getBody($page) {
67
		if (stripos($page, "</body") !== false) {