Skip to content

Commit b06c258

Browse files
Merge pull request #4531 from SteveGilvarry/Fix_onvif_probe_encoding
Fix ONVIF password URL encoding in camera configuration
2 parents cc8e84f + 639bb68 commit b06c258

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/includes/functions.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,6 +2422,11 @@ function extract_auth_values_from_url($url) {
24222422
$username = substr( $url, $protocolPrefixPos+3, $fieldsSeparatorPos-($protocolPrefixPos+3) );
24232423
$password = substr( $url, $fieldsSeparatorPos+1, $authSeparatorPos-$fieldsSeparatorPos-1 );
24242424

2425+
// URL decode the credentials since they may contain encoded special characters
2426+
// from ONVIF probe or manual URL entry
2427+
$username = urldecode($username);
2428+
$password = urldecode($password);
2429+
24252430
return array( $username, $password );
24262431
}
24272432

0 commit comments

Comments
 (0)