Code Duplication    Length = 17-17 lines in 2 locations

includes/specials/SpecialVersion.php 2 locations

@@ 1005-1021 (lines=17) @@
1002
	 * @return bool|string False if no such file exists, otherwise returns
1003
	 * a path to it.
1004
	 */
1005
	public static function getExtAuthorsFileName( $extDir ) {
1006
		if ( !$extDir ) {
1007
			return false;
1008
		}
1009
1010
		foreach ( scandir( $extDir ) as $file ) {
1011
			$fullPath = $extDir . DIRECTORY_SEPARATOR . $file;
1012
			if ( preg_match( '/^((AUTHORS)|(CREDITS))(\.txt|\.wiki|\.mediawiki)?$/', $file ) &&
1013
				is_readable( $fullPath ) &&
1014
				is_file( $fullPath )
1015
			) {
1016
				return $fullPath;
1017
			}
1018
		}
1019
1020
		return false;
1021
	}
1022
1023
	/**
1024
	 * Obtains the full path of an extensions copying or license file if
@@ 1034-1050 (lines=17) @@
1031
	 * @return bool|string False if no such file exists, otherwise returns
1032
	 * a path to it.
1033
	 */
1034
	public static function getExtLicenseFileName( $extDir ) {
1035
		if ( !$extDir ) {
1036
			return false;
1037
		}
1038
1039
		foreach ( scandir( $extDir ) as $file ) {
1040
			$fullPath = $extDir . DIRECTORY_SEPARATOR . $file;
1041
			if ( preg_match( '/^((COPYING)|(LICENSE))(\.txt)?$/', $file ) &&
1042
				is_readable( $fullPath ) &&
1043
				is_file( $fullPath )
1044
			) {
1045
				return $fullPath;
1046
			}
1047
		}
1048
1049
		return false;
1050
	}
1051
1052
	/**
1053
	 * Convert an array of items into a list for display.