1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
Peter Kokot d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Gabriel Caruso 9c144e0d82 Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Joe Watkins 7945dca6ec Merge branch 'PHP-7.1'
* PHP-7.1:
  fix bug #74780 parse_url() borken when query string contains colon
  Update NEWS
2017-06-22 11:53:27 +01:00
Joe Watkins ed1f64e083 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix bug #74780 parse_url() borken when query string contains colon
2017-06-22 11:52:39 +01:00
jhdxr db287b2303 fix bug #74780 parse_url() borken when query string contains colon 2017-06-22 11:52:06 +01:00
Nikita Popov b3ca0c2500 zend-test extension to house code that is required for testing internal APIs, but that we would not want to expose for regular builds 2017-03-12 18:58:50 +00:00
Pedro Magalhães 9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Nikita Popov 9c1c8be7a2 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-08 01:10:37 +02:00
Nikita Popov 159de7723e Merge branch 'PHP-5.6' into PHP-7.0 2016-10-08 01:06:02 +02:00
Nikita Popov b061fa909d Fix bug #73192 2016-10-08 01:04:22 +02:00
Nikita Popov 1c468ee044 Revert "Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986"
This reverts commit 085dfca02b.
2016-10-08 00:43:17 +02:00
Stanislav Malyshev 56e19b7c75 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test
  Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986
  Apparently negative wordwrap is a thing and should work as length = 0.
2016-10-04 21:56:28 -07:00
Ilia Alshanetsky 085dfca02b Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986 2016-10-04 21:20:31 -07:00
Remi Collet 60bb15d8a1 add skipif (needs json) 2016-08-03 11:03:22 +02:00
Nikita Popov bb51da29dc Make base64_decode() in non-strict mode binary safe 2016-07-22 18:20:34 +02:00
Lauri Kenttä cab5f6a889 base64_decode: Add tests 2016-07-22 18:03:56 +02:00
Lauri Kenttä 5c62f3f68e base64_decode: strict: Fail on excessive padding 2016-07-22 18:03:56 +02:00
Lauri Kenttä 586a0761ff base64_decode: strict: Fail on truncated input 2016-07-22 18:03:56 +02:00
Julien Pauli e2add3ed87 Fixed parse_url() for better compliance with RFC3986 2016-06-22 14:05:25 +02:00
Ilia Alshanetsky f705063e23 Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986 2015-12-22 18:12:56 +01:00
Ferenc Kovacs 1e66f1b9ad Merge branch 'pr-1204'
* pr-1204:
  no need for default value
  allow passing null as the third param
  Implemented FR #55716 - Add an option to pass a custom stream context
2015-10-08 10:23:24 +02:00
Christoph M. Becker e49922d3f8 Fix #69976: Unable to parse "all" urls with colon char
If a colon occurs in a query string or fragment of a partial URL without
scheme, parse_url() tries to regard it as port separator. If up to 5 digits
follow and then a slash or the end of the string, parse_url() fails.

We're fixing this by checking whether the colon is part of the query string or
the fragment, under the assumption that question marks and hash signs are only
allowed as separators of query string and fragments, respectively, what is
guarenteed for URIs (RFC 3986), but not necessarily for URLs (RFC 1738) where
question marks are allowed for usernames and passwords.

Anyhow, this constitutes a minor BC, so the fix is applied to master only.
2015-07-01 23:48:16 +02:00
Ferenc Kovacs fd01b47b8e Implemented FR #55716 - Add an option to pass a custom stream context 2015-03-30 01:09:07 +02:00
Tjerk Meesters 1236a30746 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68917 (parse_url fails on some partial urls)
  Update test to run locally instead of remotely
2015-03-06 20:59:52 +08:00
Tjerk Meesters d7fb52ea20 Fixed bug #68917 (parse_url fails on some partial urls) 2015-03-06 20:51:22 +08:00
Andrea Faulds e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Andrea Faulds b70779304c Fixed some 32-bit tests 2014-11-09 01:53:52 +00:00
Tjerk Meesters d0e51f5ce9 Fixed bug #68129
Empty usernames and passwords are now treated differently from no username or password

For example, empty password:

    ftp://user:@example.org

Empty username:

    ftp://:password@example.org

Empty username and empty password

    ftp://:@example.org
2014-10-09 08:21:30 +08:00
Stanislav Malyshev 03c703b8bd add a test case previously broken by a bad fix 2014-04-24 23:58:38 -07:00
Stanislav Malyshev a328803803 Revert "Fixed bug #64604"
This reverts commit b05c088a3a.
Breaks parsing urls where query has : in it, like: /foo/bar?baz=goo:boo
2014-04-24 23:50:45 -07:00
Ingo Walz b05c088a3a Fixed bug #64604 2014-04-13 18:37:40 -07:00
Sara Golemon 8b6b39fdcf Add a couple more test cases to parse_url() tests
http://::# (valid but silly)
http://#   (invalid)
2013-11-06 10:32:11 +01:00
Stanislav Malyshev bf064112b7 fix test and move to proper place 2012-09-30 19:24:42 -07:00
Andrew Faulds 36b88d77f2 bug #62844; relative URL schemes in parse_url() 2012-08-19 22:15:58 -07:00
Stanislav Malyshev d81ea16ef1 Changed silent conversion of array to string to produce a notice. (Patrick) 2011-10-21 06:08:47 +00:00
Ilia Alshanetsky 9915700fa1 Fixed bug #55273 (base64_decode() with strict rejects whitespace after pad) 2011-09-12 17:20:24 +00:00
Ilia Alshanetsky 46513c07dc Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path) 2011-08-11 13:01:52 +00:00
Pierrick Charron 6e74d95f34 Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment) 2011-03-13 04:02:56 +00:00
Ilia Alshanetsky 6186c16449 Fixed parse_url() tests to account for port validation 2011-02-06 17:23:57 +00:00
Ilia Alshanetsky 4bc5cac317 Fixed bug #52327 (base64_decode() improper handling of leading padding in strict mode) 2010-11-26 20:59:13 +00:00
Felipe Pena 83ebbc36a1 - Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char).
patch by: Justin Martin (frozenfire@php)
2010-11-07 12:59:22 +00:00
Pierre Joye cba1ed2475 - #50563, removing E_WARNING from parse_url() 2010-06-16 18:56:24 +00:00
Zoe Slattery 6a22ec3eda More tests from 2009 testfest 2009-08-30 09:30:13 +00:00
Zoe Slattery 1c98e49afd Test from 2009 testfest 2009-08-26 17:17:58 +00:00
Matt Wilmas 26cde1ee2f MFH: Updated tests after double->long conversion change (basically to match 5.2)
# Let me know about other failing tests I missed
2009-06-04 18:25:06 +00:00
Arnaud Le Blanc a772d7c3ef MFH 2009-04-24 19:48:41 +00:00