Git Product home page Git Product logo

zend-uri's Introduction

Logo

Welcome to the Zend Framework 3.0 Release!

RELEASE INFORMATION

Zend Framework 3.0.1dev

This is the first maintenance release for the Zend Framework 3 series.

DD MMM YYYY

UPDATES IN 3.0.1

Please see CHANGELOG.md.

SYSTEM REQUIREMENTS

Zend Framework 3 requires PHP 5.6 or later; we recommend using the latest PHP version whenever possible.

INSTALLATION

We no longer recommend installing this package directly. The package is a metapackage that aggregates all components (and/or integrations) originally shipped with Zend Framework; in most cases, you will want a subset, and these may be installed separately; see https://docs.zendframework.com/ for a list of available packages and installation instructions for each.

We recommend using either the zend-mvc skeleton application:

$ composer create-project zendframework/skeleton-application project

or the Expressive skeleton application:

$ composer create-project zendframework/zend-expressive-skeleton project

The primary use case for installing the entire framework is when upgrading from a version 2 release.

If you decide you still want to install the entire framework:

$ composer require zendframework/zendframework

GETTING STARTED

A great place to get up-to-speed quickly is the Zend Framework QuickStart.

The QuickStart covers some of the most commonly used components of ZF. Since Zend Framework is designed with a use-at-will architecture and components are loosely coupled, you can select and use only those components that are needed for your project.

MIGRATION

For detailed information on migration from v2 to v3, please read our Migration Guide.

COMPONENTS

This package is a metapackage aggregating the following components:

CONTRIBUTING

If you wish to contribute to Zend Framework, please read the CONTRIBUTING.md and CODE_OF_CONDUCT.md files.

QUESTIONS AND FEEDBACK

Online documentation can be found at https://docs.zendframework.com/. Questions that are not addressed in the manual should be directed to the relevant repository, as linked above.

If you find code in this release behaving in an unexpected manner or contrary to its documented behavior, please create an issue with the relevant repository, as linked above.

Reporting Potential Security Issues

If you have encountered a potential security vulnerability in Zend Framework, please report it to us at [email protected]. We will work with you to verify the vulnerability and patch it.

When reporting issues, please provide the following information:

  • Component(s) affected
  • A description indicating how to reproduce the issue
  • A summary of the security vulnerability and impact

We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure; this helps protect Zend Framework users and provides them with a chance to upgrade and/or update in order to protect their applications.

For sensitive email communications, please use our PGP key.

LICENSE

The files in this archive are released under the Zend Framework license. You can find a copy of this license in LICENSE.md.

ACKNOWLEDGEMENTS

The Zend Framework team would like to thank all the contributors to the Zend Framework project; our corporate sponsor, Zend Technologies / Rogue Wave Software; and you, the Zend Framework user.

Please visit us sometime soon at http://framework.zend.com.

zend-uri's People

Contributors

akrabat avatar bakura10 avatar dasprid avatar davidwindell avatar evandotpro avatar ezimuel avatar freeaqingme avatar jonathanmaron avatar kokspflanze avatar koopzington avatar maks3w avatar marc-mabe avatar michalbundyra avatar mikaelkael avatar mpinkston avatar mtagliab avatar mwillbanks avatar ocramius avatar padraic avatar prolic avatar ralphschindler avatar samsonasik avatar senseexception avatar sgehrig avatar thinkscape avatar thomasweidner avatar vahid-sohrabloo avatar veewee avatar wdalmut avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zend-uri's Issues

Usage of reserved characters in path, unencoded

This issue was originally submitted as zendframework/zendframework#6153.

This is a valid LinkedIn API URL:

https://api.linkedin.com/v1/people/~:(first-name,last-name,email-address)

Using the following code:

$uri = new \Zend\Uri\Http();
$uri->setScheme('https');
$uri->setHost('api.linkedin.com');
$uri->setPath('/v1/people/~:(first-name,last-name,email-address,picture-url)');
echo $uri;

Results in:

https://api.linkedin.com/v1/people/~:%28first-name,last-name,email-address,picture-url%29

The reserved bracket characters are escaped. This resulting URL is not a valid LinkedIn API URL.

Zend\Uri\Uri::toString() uses self::encodePath($this->path) internally, making it impossible to override encodePath()'s behaviour by extending Zend\Uri\Http and replacing the method.

My understanding of the RFC is that reserved characters need not necessarily be escaped where they are being used as delimiters. Should there be some way to represent URLs such as the above?

Failed to download zendframework/zend-uri

  • Installing zendframework/zend-uri (dev-develop ed906be)
    Failed to download zendframework/zend-uri from source: Could not delete /home/vagrant/projects/web/zf2/opevere/vendor/zendframework/zend-uri/.git/objects/pack/tmp_pack_9zExI7:
    Now trying to download from dist

Feature: new URI type (for http over unix socket)

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/6624
User: @slopjong
Created On: 2014-09-02T17:00:33Z
Updated At: 2015-02-22T18:11:33Z
Body
Unix sockets are also used for http, however, no existing URI type allows specifying an URI that takes a filepath as the authority which is a requirement in order to use the path for the actual web resource. Related to PR #6626.


Comment

User: @SwissEngine
Created On: 2014-09-02T18:43:30Z
Updated At: 2014-09-02T18:43:30Z
Body
http://php.net/manual/en/transports.php

Other sockets can be implemented too, could you add them ?


Comment

User: @Ocramius
Created On: 2014-12-24T00:09:38Z
Updated At: 2014-12-24T00:09:38Z
Body
This new feature requires careful unit-testing


Comment

User: @slopjong
Created On: 2014-12-24T15:47:33Z
Updated At: 2014-12-24T15:47:33Z
Body
@Ocramius I'll work on this and other PRs next days, are you on freenode sometimes? Just for the case I have some questions. I'll author the PRs all at once.


Comment

User: @Ocramius
Created On: 2014-12-24T16:34:39Z
Updated At: 2014-12-24T16:34:39Z
Body
@slopjong not these Christmas days, but I' tend to be on IRC, yes :)


Comment

User: @weierophinney
Created On: 2015-02-19T19:27:08Z
Updated At: 2015-02-19T19:27:08Z
Body
@slopjong โ€” I'd love to have this for 2.4; will you be able to prepare tests in the next 2 weeks? If so, I'll add it to the milestone.


Comment

User: @slopjong
Created On: 2015-02-19T21:00:51Z
Updated At: 2015-02-19T21:00:51Z
Body
Yes. I'll definitely work on it this weekend. I was too busy in the past weeks/months.


Comment

User: @weierophinney
Created On: 2015-02-19T21:40:24Z
Updated At: 2015-02-19T21:40:24Z
Body
@slopjong cool -- I'll keep this under the "awaiting author updates", which will make it easy for me to search for changes in the next week; once I see the tests, I'll assign the milestone.


Parsed and unparsed uri is not a same

Example:
$source_uri = '/?#';
$parsed_uri = Zend\Uri\UriFactory::factory($source_uri, 'http');
$unparsed_uri = $parsed_uri->toString();
echo $unparsed_uri; // we see '/', but must be same as source uri

It's because in Zend\Uri::toString() only host check on null. Can you fix it, please, and add check on null with other uri components? It will be more right behavior of this method.

Method strtolower break case sensitive aliases

@weierophinney you was right with breakage. Simple case from Magento 2.3. Host is not always domain or IP address. When we using docker we can call host via container names.

Example:

host = MAGENTO2_varnish

When we call strtolower then we getting error:

[2019-03-12 11:10:23] main.CRITICAL: Unable to connect to magento2_varnish:80 . Error #0: stream_socket_client(): unable to connect to magento2_varnish:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) {"method":"GET","url":"http:/","invalidateInfo":{"server":"[object] (Zend\\Uri\\Uri: http://magento2_varnish:80/)","tagsPattern":".*"}} []

So MAGENTO2_varnish != magento2_varnish.

If anyone ( like me ) using aliases on magento then this patch break eg. Varnish Purge request.

Originally posted by @bmxmale in #29 (comment)

Invalid parsing/encoding of the URI userinfo

Some characters are not properly parsed from string, and encoded when converted to string, in the userinfo. For example, the "@" char should be represented in strings as "%40" (but passed as "@" to the Authorization header for HTTP), and userinfo containing percent-encoded chars should be decoded/encoded the right way.

It seems that the following comment about "@" in https://github.com/zendframework/zend-uri/blob/master/src/Uri.php#L297 is wrong:

                // The userInfo can also contain '@' symbols; split $authority
                // into segments, and set it to the last segment.

form my understanding of the RFC-3986:

    userinfo    = *( unreserved / pct-encoded / sub-delims / ":" )
    unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
    pct-encoded = "%" HEXDIG HEXDIG
    sub-delims  = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="

parsing the url with host returns no host

I am not sure if this is expected or is a problem.
For example when I use a example url like :

$uri = UriFactory::factory('www.test.de/test/bild1.jpg');
echo $uri->getHost();

I was would expecting it to actually get the host i.e. www.test.de but get null instead.

Can this be a bug or am I missing something?

Host contain a colon when port is empty

i think in this case we have technically valid url, parse_url function also correct parses host

Example:

$source_uri = 'http://example.com:/';
echo 'parse_url: ';
var_dump(parse_url($source_uri));

$uri = new \Zend\Uri\Http($source_uri);
$tmp = [
    'scheme' => $uri->getScheme(),
    'user' => $uri->getUserInfo(),
    'host' => $uri->getHost(),
    'port' => $uri->getPort(),
    'path' => $uri->getPath(),
    'query' => $uri->getQuery(),
    'fragment' => $uri->getFragment(),
];
echo "\nzend-uri: ";
var_dump($tmp);

result output:

parse_url:
array (size=3)
      'scheme' => string 'http' (length=4)
      'host' => string 'example.com' (length=11)
      'path' => string '/' (length=1)
zend-uri:
array (size=7)
      'scheme' => string 'http' (length=4)
      'user' => null
      'host' => string 'example.com:' (length=12)
      'port' => int 80
      'path' => string '/' (length=1)
      'query' => null
      'fragment' => null

URI prefix 'android-app://' breaks UriFactory

Hi,

I'm seeing people accessing my site e.g. over the LinkedIn android app. The original referer is "android-app://com.linkedin.android"

This breaks zend-http which uses zend-uri:

PHP Fatal error: Uncaught Zend\Uri\Exception\InvalidArgumentException: no class registered for scheme "android-app" in .../zendframework/zend-uri/src/UriFactory.php:104

Is it possible to add a scheme?

Regards
fr00x

Host Parsing of IPv6-URI with port

Hi,

As you probably know IPv6 addresses with ports are wrapped in square brackets (because the colon sign also appears in the IP address itself).

These brackets are not treated (removed) in any way currently, what leads to an behaviour I didn't expect.
I'd expect getHost() to return only the IP address, without brackets, as the port is stored seperately and obtainable via getPort().

Consider this example:

$ipv4Port = new \Zend\Uri\Uri('http://192.168.0.1:8080');
$ipv6Port = new \Zend\Uri\Uri('http://[fe80::240:63ff:fede:3c19]:8080');

echo $ipv4Port->getHost(); // -> 192.168.0.1 - expected
echo $ipv6Port->getHost(); // -> [fe80::240:63ff:fede:3c19] - unexpected

Is this intended behaviour, though, or just not yet adjusted to IPv6?

URI is not valid and cannot be converted into a string

Please, anyone, help me to resolve this error.

a:4:{i:0;s:54:"URI is not valid and cannot be converted into a string";i:1;s:1717:"#0 /home/magento/public_html/voylite/vendor/zendframework/zend-http/src/Header/AbstractLocation.php(98): Zend\Uri\Uri->toString()
#1 /home/magento/public_html/voylite/vendor/zendframework/zend-http/src/Header/AbstractLocation.php(133): Zend\Http\Header\AbstractLocation->getUri()
#2 /home/magento/public_html/voylite/vendor/zendframework/zend-http/src/PhpEnvironment/Response.php(98): Zend\Http\Header\AbstractLocation->toString()
#3 /home/magento/public_html/voylite/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(310): Zend\Http\PhpEnvironment\Response->sendHeaders()
#4 /home/magento/public_html/voylite/vendor/zendframework/zend-http/src/PhpEnvironment/Response.php(128): Magento\Framework\App\Response\Http\Interceptor->sendHeaders()
#5 /home/magento/public_html/voylite/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(336): Zend\Http\PhpEnvironment\Response->send()
#6 /home/magento/public_html/voylite/vendor/magento/framework/HTTP/PhpEnvironment/Response.php(44): Magento\Framework\App\Response\Http\Interceptor->send()
#7 /home/magento/public_html/voylite/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\HTTP\PhpEnvironment\Response->sendResponse()
#8 /home/magento/public_html/voylite/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array)
#9 /home/magento/public_html/voylite/vendor/magento/framework/App/Bootstrap.php(259): Magento\Framework\App\Response\Http\Interceptor->sendResponse()
#10 /home/magento/public_html/voylite/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#11 {main}";s:3:"url";s:93:"/voylite/checkout/cart/add/uenc/aHR0cDovL21hZ2VudG8ud2F0c21vLmNvbS92b3lsaXRlLw,,/product/117/";s:11:"script_name";s:18:"/voylite/index.php";}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.