Code Duplication    Length = 13-13 lines in 2 locations

lib/includes/loader.web.auth.php 1 location

@@ 264-276 (lines=13) @@
261
		return $data;
262
	}
263
264
	function ldEncodeCookie($cookie) {
265
		global $AR;
266
		$data = json_encode($cookie);
267
		if(isset($AR->sessionCryptoKey) && function_exists('mcrypt_encrypt') ) {
268
			$key = base64_decode($AR->sessionCryptoKey);
269
			$crypto = new ar_crypt($key,MCRYPT_RIJNDAEL_256,1);
270
			$encdata = $crypto->crypt($data);
271
			if($encdata !== false) {
272
				$data = $encdata;
273
			}
274
		}
275
		return $data;
276
	}
277

lib/includes/loader.webdav.auth.php 1 location

@@ 136-148 (lines=13) @@
133
		return $data;
134
	}
135
136
	function ldEncodeCookie($cookie) {
137
		global $AR;
138
		$data = json_encode($cookie);
139
		if(isset($AR->sessionCryptoKey)) {
140
			$key = base64_decode($AR->sessionCryptoKey);
141
			$crypto = new ar_crypt($key,MCRYPT_RIJNDAEL_256,1);
142
			$encdata = $crypto->crypt($data);
143
			if($encdata !== false) {
144
				$data = $encdata;
145
			}
146
		}
147
		return $data;
148
	}
149