Code Duplication    Length = 13-13 lines in 2 locations

projects/packages/password-checker/src/class-password-checker.php 1 location

@@ 296-308 (lines=13) @@
293
	 * @param array $test_data the current test data.
294
	 * @return Boolean does the test pass?
295
	 */
296
	protected function test_preg_match( $test_data ) {
297
		$password = stripslashes( $this->password );
298
299
		if ( isset( $test_data['trim'] ) ) {
300
			$password = substr( $password, 1, -1 );
301
		}
302
303
		if ( ! preg_match( '/' . $test_data['pattern'] . '/u', $password ) ) {
304
			return false;
305
		}
306
307
		return true;
308
	}
309
310
	/**
311
	 * Provides the comparison tester functionality.

projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php 1 location

@@ 294-306 (lines=13) @@
291
	 * @param array $test_data the current test data.
292
	 * @return Boolean does the test pass?
293
	 */
294
	protected function test_preg_match( $test_data ) {
295
		$password = stripslashes( $this->password );
296
297
		if ( isset( $test_data['trim'] ) ) {
298
			$password = substr( $password, 1, -1 );
299
		}
300
301
		if ( ! preg_match( '/' . $test_data['pattern'] . '/u', $password ) ) {
302
			return false;
303
		}
304
305
		return true;
306
	}
307
308
	/**
309
	 * Provides the comparison tester functionality.