php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65138 Parse url don't recognize SMB protocol users
Submitted: 2013-06-26 20:35 UTC Modified: 2013-07-03 21:57 UTC
From: roberto at spadim dot com dot br Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.5.0 OS: any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: roberto at spadim dot com dot br
New email:
PHP Version: OS:

 

 [2013-06-26 20:35 UTC] roberto at spadim dot com dot br
Description:
------------
i have a url using smb protocol (or cifs) it don't return the right user/password:
url:

smb://domain/user@password:host/folder

another problem with smb is the password... some passwords have @ and : 
characters...


any idea how to solve this?

Test script:
---------------
print_r(parse_url("smb://domain/user@password:host/folder"));

Expected result:
----------------
array (
  'scheme' => 'smb',
  'user' => 'domain/user',
  'password' => 'password',
  'host' => 'host',
  'path' => 'folder'
)

Actual result:
--------------
array (
  'scheme' => 'smb',
  'host' => 'domain',
  'path' => '/user@password:host/folder'
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-03 21:57 UTC] felipe@php.net
-Status: Open +Status: Not a bug
 [2013-07-03 21:57 UTC] felipe@php.net
parse_url() is not intended to parse smb uris.

Try something like https://github.com/owncloud/3rdparty/blob/master/smb4php/smb.php does.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 03:01:31 2025 UTC