Skip to content

Commit

Permalink
Fixed well-known ports dictionary reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnrDaemon committed Nov 3, 2017
1 parent 34d27e0 commit 4ca2e8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------------------------------------------------------------------
r705 | anrdaemon | 2017-11-03 04:26:01 +0300 (Пт, 03 ноя 2017) | 2 lines

* Fixed ports dictionary reference.

------------------------------------------------------------------------
r704 | anrdaemon | 2017-11-03 03:39:21 +0300 (Пт, 03 ноя 2017) | 2 lines

Expand Down
6 changes: 3 additions & 3 deletions Net/Url.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/** URL handling class.
*
* @version SVN: $Id: Url.php 703 2017-11-03 00:36:44Z anrdaemon $
* @version SVN: $Id: Url.php 705 2017-11-03 01:26:01Z anrdaemon $
*/

namespace AnrDaemon\Net;
Expand Down Expand Up @@ -358,8 +358,8 @@ function __toString()

$result .= idn_to_ascii($parts['host']);

if(isset($parts['port'], $parts['scheme'], $this::$defaultPorts[$parts['scheme']]))
if($parts['port'] == $this::$defaultPorts[$parts['scheme']])
if(isset($parts['port'], $parts['scheme'], self::$defaultPorts[$parts['scheme']]))
if($parts['port'] == self::$defaultPorts[$parts['scheme']])
unset($parts['port']);

if(isset($parts['port']))
Expand Down

0 comments on commit 4ca2e8c

Please sign in to comment.