Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

parse_url doesn't returns a string and not an array for the query key #65

Closed
Taluu opened this issue Aug 28, 2014 · 2 comments
Closed

Comments

@Taluu
Copy link
Contributor

Taluu commented Aug 28, 2014

cf the comment of @kcahir : d329a8a#commitcomment-7571516

@Taluu Taluu added 3.0 labels Aug 28, 2014
@kbu1564
Copy link
Contributor

kbu1564 commented Aug 28, 2014

http://php.net/manual/en/function.parse-url.php
On seriously malformed URLs, parse_url() may return FALSE.

if $url's parameter of parse_url() is wrong url data, that is return false.
I think it should be work about false of return value like before.

https://github.com/Wisembly/elephant.io/blob/refacto-3.0/src/Engine/AbstractSocketIO.php

/**
 * Parse an url into parts we may expect
 *
 * @return string[] information on the given URL
 */
protected function parseUrl($url)
{
    if (($server = parse_url($url)) === false)
    //  throw new ServerConnectionFailureException; ??
        return ['scheme' => 'http',
                'host'   => 'localhost',
                'path'   => 'socket.io',
                'secured' => false];

    if (!isset($server['port'])) {
        $server['port'] = 'https' === $server['scheme'] ? 443 : 80;
    }

    $server['secured'] = 'https' === $server['scheme'];

    return $server;
}

Taluu added a commit that referenced this issue Aug 29, 2014
parse connection query string into array (fixes #65)
@Taluu Taluu closed this as completed Aug 29, 2014
@Taluu
Copy link
Contributor Author

Taluu commented Aug 29, 2014

fixed by #64 ; for the return of the parse_url, I'll be opening a new ticket and fix it, as your comment make sense.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants