Code Duplication    Length = 8-9 lines in 2 locations

apps/files_external/lib/config.php 2 locations

@@ 777-785 (lines=9) @@
774
	 * @param array $options mount options
775
	 * @return array updated options
776
	 */
777
	private static function encryptPasswords($options) {
778
		if (isset($options['password'])) {
779
			$options['password_encrypted'] = self::encryptPassword($options['password']);
780
			// do not unset the password, we want to keep the keys order
781
			// on load... because that's how the UI currently works
782
			$options['password'] = '';
783
		}
784
		return $options;
785
	}
786
787
	/**
788
	 * Decrypt passwords in the given config options
@@ 793-800 (lines=8) @@
790
	 * @param array $options mount options
791
	 * @return array updated options
792
	 */
793
	private static function decryptPasswords($options) {
794
		// note: legacy options might still have the unencrypted password in the "password" field
795
		if (isset($options['password_encrypted'])) {
796
			$options['password'] = self::decryptPassword($options['password_encrypted']);
797
			unset($options['password_encrypted']);
798
		}
799
		return $options;
800
	}
801
802
	/**
803
	 * Encrypt a single password