Explorar o código

API: sanitize username

https://github.com/marienfressinaud/FreshRSS/issues/13
Alexandre Alapetite %!s(int64=12) %!d(string=hai) anos
pai
achega
d79da54c98
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      p/api/greader.php

+ 4 - 1
p/api/greader.php

@@ -124,7 +124,10 @@ function authorizationToUser() {
 	if ($headerAuth != '') {
 		$headerAuthX = explode('/', $headerAuth, 2);
 		if ((count($headerAuthX) === 2) && ($headerAuthX[1] === TEMP_AUTH)) {
-			return $headerAuthX[0];
+			$user = $headerAuthX[0];
+			if (ctype_alnum($user)) {
+				return $user;
+			}
 		}
 	}
 	return null;