1
0
mirror of https://github.com/php/php-src.git synced 2026-04-15 12:01:07 +02:00
Commit Graph

1960 Commits

Author SHA1 Message Date
Christoph M. Becker
254a5914ad Fix #77431 SplFileInfo::__construct() accepts NUL bytes
`SplFileInfo::__construct()` has to expect a path instead of a string,
analogous to `SplFileObject::__construct()`.
2019-03-03 18:23:46 -08:00
Peter Kokot
113213f027 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:29:24 +02:00
Peter Kokot
7af945e271 Trim trailing whitespace in *.phpt 2018-10-14 19:43:12 +02:00
Peter Kokot
03f3b8479b Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:51:01 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
3f72c77ce4 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:21:27 +02:00
Christoph M. Becker
32a728d351 Fix #68825: Exception in DirectoryIterator::getLinkTarget()
intern->file_name may not have been properly set when
DirectoryIterator::getLinkTarget() is called, so we make sure it is
before using it.
2018-08-22 15:37:02 +02:00
Christoph M. Becker
4c448334bd Add regression test for bug #68175 2018-08-18 14:36:16 +02:00
Tim Siebels
3257d22fea Fix #68175: RegexIterator pregFlags are NULL instead of 0 2018-08-18 14:33:39 +02:00
Xinchen Hui
8f221bdec0 Fixed bug #76367 (NoRewindIterator segfault 11) 2018-05-23 14:45:38 +08:00
Gabriel Caruso
63934ea71e Fix #76131 some arginfo params are different from the documentation 2018-03-27 21:56:46 +02:00
CHU Zhaowei
01eafceea1 Fixed bug #74519 strange behavior of AppendIterator 2018-02-08 10:16:24 +01:00
CHU Zhaowei
495508eceb fix #74519 strange behavior of AppendIterator 2018-02-08 10:15:09 +01:00
Christoph M. Becker
a882f95e39 Revert "Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature"
This reverts commit 4bd7658e1b.

To avoid the BC break we apply the fix to master only.
2018-01-27 13:11:30 +01:00
Christoph M. Becker
4bd7658e1b Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature 2018-01-27 12:33:36 +01:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Nikita Popov
f14b6f4920 Fixed bug #73209 2017-12-22 18:22:00 +01:00
Nikita Popov
ec142f2c86 Fixed bug #75242 2017-12-22 18:11:38 +01:00
Nikita Popov
ccb113c3e5 Fixed bug #75717 2017-12-22 18:01:03 +01:00
Xinchen Hui
e8c200515a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
  Compiler warning
2017-09-24 17:24:23 +08:00
Xinchen Hui
db63367871 Compiler warning 2017-09-24 17:19:05 +08:00
Christoph M. Becker
0c0b955d5f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
2017-09-20 15:47:02 +02:00
Christoph M. Becker
eedc060c92 Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
We must not overwrite the SPL_DLLIST_IT_FIX flag when changing the
iterator mode.
2017-09-20 15:46:04 +02:00
Joe Watkins
7015d22116 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop
2017-09-12 07:06:35 +01:00
jhdxr
3e11b7fc21 fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop 2017-09-12 07:05:58 +01:00
Nikita Popov
c2e3541cc1 Add test for bug #75155 2017-09-04 21:23:07 +02:00
Nikita Popov
b689857d53 Revert "Fixed #74977 - Appending AppendIterator leads to segfault"
This reverts commit dbc2ffba82.
2017-09-04 21:20:49 +02:00
Xinchen Hui
307acb6618 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
2017-08-09 11:29:13 +08:00
Xinchen Hui
b06f8cb58b Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results) 2017-08-09 11:28:53 +08:00
Julien Pauli
cd06b5af09 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Updated NEWS
  Fix #75015. Crash in SPL destructors
2017-08-01 16:02:00 +02:00
Julien Pauli
64e6ddc7f7 Fix #75015. Crash in SPL destructors 2017-08-01 15:59:54 +02:00
andrewnester
dbc2ffba82 Fixed #74977 - Appending AppendIterator leads to segfault 2017-07-25 06:39:50 +01:00
Nikita Popov
8e7c99acf4 Merge branch 'PHP-7.0' into PHP-7.1 2017-07-18 22:16:11 +02:00
andrewnester
afc22828ea Fixed #74699 - Broken ArrayIterator unserializing 2017-07-18 22:14:11 +02:00
Joe Watkins
bd8940a1fe Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix method "eof"
2017-06-23 07:53:12 +01:00
danchukas
b255b97e43 fix method "eof"
replace "eof" with  "feof"
because:
1) http://php.net/manual/ru/function.feof.php
2) Error: Call to undefined function eof()
2017-06-23 07:53:00 +01:00
Joe Watkins
c56378b0d5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix bug #73471 PHP freezes with AppendIterator
2017-06-22 11:57:39 +01:00
jhdxr
81c2a4b9ba fix bug #73471 PHP freezes with AppendIterator 2017-06-22 11:56:49 +01:00
Nikita Popov
e7a7065024 Merge branch 'PHP-7.0' into PHP-7.1 2017-05-24 18:02:13 +02:00
jhdxr
872e43d6e5 Fixed bug #74478 2017-05-24 18:01:41 +02:00
Nikita Popov
e3f411c9f7 Merge branch 'PHP-7.0' into PHP-7.1 2017-05-01 12:15:41 +02:00
Nikita Popov
1967950dc3 Fix typo in SplFixedArray has_dimension implementation 2017-05-01 12:15:26 +02:00
Xinchen Hui
9f263c257a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74218 (ArrayIterator error message is confusing)
2017-03-10 15:16:01 +08:00
Xinchen Hui
c398198c0a Fixed bug #74218 (ArrayIterator error message is confusing) 2017-03-10 15:15:31 +08:00
andrewnester
8f799137d7 Fixed bug #74058
Fall back from get_property_ptr_ptr to read_property if offsetGet
is overridden.
2017-03-09 00:10:00 +01:00
Nikita Popov
a381b61f03 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-16 17:00:21 +01:00
Nikita Popov
708973c9bd Fix autoload_func_info destruction
Can't reference the function ptr after the closure has been
destroyed.
2017-02-16 16:59:17 +01:00
Dmitry Stogov
5753a753c7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73896 (spl_autoload() crashes when calls magic _call())
2017-01-09 15:12:22 +03:00
Dmitry Stogov
4f1b24d974 Fixed bug #73896 (spl_autoload() crashes when calls magic _call()) 2017-01-09 15:11:33 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00