Commit graph

26838 commits

Author SHA1 Message Date
ctcq
41fde0caa4
Add note to FILTER_SANITIZE_STRING for encoding quotes (#530)
Co-authored-by: Christopher Wiedey <c_wied05@uni-muenster.de>
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2021-04-16 15:52:30 +01:00
Juliette
f3b5475eeb
PHP 8.0 migration/deprecated: expand on libxml_disable_entity_loader() (#528)
The current text in the migration guide about the deprecation of `libxml_disable_entity_loader()` is misleading and can easily lead to the introduction of XXE vulnerable code.

In select circumstances, when `LIBXML_NOENT` is used, code can still be vulnerable to XXE attacks, even on PHP 8.0.
So I'm proposing to add an appropriate warning and mention the upgrade path in the migration guide.

Includes fixing a typo on the `libxml_disable_entity_loader()` page.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-04-16 10:44:07 +02:00
Kamil Tekiela
2a5459cd41
Fix typo with <methodname> 2021-04-15 18:34:33 +01:00
Rowan Tommins
b23076d969
Expand documentation for mb_detect_encoding (#527)
- People expect this function to work miracles. Add some examples
  of why that's not possible. Hat tip to this FAQ for the cipher
  comparison: https://chardet.readthedocs.io/en/latest/faq.html
- The strict parameter wasn't really explained at all. I *think*
  this is what it actually does.
- General expansion and grammar fixes (I suspect the original
  author didn't speak English as a first language, which makes
  sense since the mbstring extension originated in Japan).
2021-04-14 14:05:39 +02:00
Larry Garfield
bf28a4ce4f
Describe WeakMaps (#479)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-04-13 23:59:11 +02:00
Kim Hallberg
c07214dc9c
Fix attributes overview example emitting E_WARNING (#522)
Fix `targetDirectoryExists` method in example emits E_WARNING if `$targetDirectory` already exists.

Reference:
- https://www.php.net/manual/en/function.mkdir.php

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2021-04-13 18:57:58 +02:00
Rowan Tommins
4d3d1ebea1
Document and cross-reference mb_chr() and mb_ord() (#524) 2021-04-13 14:49:11 +02:00
沈唁
a08663f3c3
Update Swoole\Process::name (#525) 2021-04-13 11:21:45 +02:00
Rowan Tommins
4138897b12
Remove or rewrite examples using implode("", file(...)) (#523)
This is a weirdly inefficient way of getting a file's content into
a string, and I'm not sure why anyone would think it was a good
idea.
2021-04-12 22:33:56 +02:00
Larry Garfield
68a416eeb7
Remove old weakref extension (#514)
* Remove old weakref extension that no longer works and namespace conflicts with WeakMap in PHP 8.
2021-04-12 15:35:52 +02:00
Guilliam Xavier
011596bcff
Fix/update operators.precedence (#509)
- explain why associativity is not applicable to unary operators
- distinguish between unary and binary `+`/`-`
- add some missing reference links
- update the precedence of string concatenation for PHP 8
- fix "(n/a)" ("not applicable") to "non-associative" for ternary

References:
- https://github.com/php/php-src/blob/master/Zend/zend_ast.c
  (search "Operator Precedence")
- https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y
  (search "precedence")
  (NOTE: in opposite order)
2021-04-12 14:37:34 +02:00
Christoph M. Becker
6936064e73
Fix #74982: strftime %P not working on Alpine Linux 2021-04-12 14:12:41 +02:00
Kamil Tekiela
a5dd0e6824
Remove mysqli::get_client_stats (#518)
This method doesn't exist.
2021-04-12 13:59:01 +02:00
codedokode
2f79a80776
Fix list of falsy values (#519)
There is no integer -0 (minus zero)
2021-04-12 13:55:35 +02:00
Rowan Tommins
fe18943c11
Fix half-deleted sentence about "new" and reference assignment (#520)
This had a stray ")", and was left with a misleading half-sentence
about "new" returning a reference, which it doesn't.
2021-04-12 13:28:11 +02:00
沈唁
e6be4fb01d
Update Swoole getclientinfo (#521) 2021-04-12 13:27:17 +02:00
Kamil Tekiela
5c3589b9b8
Updating mysqli: bind_param (#512)
* Add mysqli_stmt_prepare to the descr.
* Simplify examples
* Fix example title
* Added new example with ...
2021-04-08 12:55:16 +02:00
Kamil Tekiela
7d6b8ade61
Updating mysqli: fetch_all (#513)
* Provided better description
* Added mysqli_stmt_get_result to the result param
* Remove misleading note
* Provided a simple example
2021-04-08 12:07:58 +02:00
Tom Sullivan
165718f97f
Remove errant , (#516) 2021-04-08 11:55:42 +02:00
沈唁
d35bf30250
Fix types of Swoole\Process::kill (#515)
Also flesh out the documentation of this method a bit.
2021-04-08 11:46:32 +02:00
Christoph M. Becker
624ad8b8de
Document enchant installation on Windows 2021-04-06 16:40:17 +02:00
Juliette
4a21d28c5b
Language Ref/Traits: fix incorrect information about abstract methods (#510)
As of PHP 8.0, `abstract private` methods are allowed in `trait`s. `abstract public` method were previously already supported.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-04-05 18:43:19 +02:00
Juliette
1ea4e4f576
escapeshellcmd: add warning about spaces in paths on Windows (#511)
It is a known issue that spaces are not escaped in shell commands, which can be especially problematic on Windows.
This adds a warning about this behaviour to the function, including a way to solve this in userland code.

Ref: https://bugs.php.net/bug.php?id=43261 (last two comments)

Also see: https://github.com/squizlabs/PHP_CodeSniffer/pull/3214

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-04-05 18:39:54 +02:00
Yoshinari Takaoka
b694d83ae9 added Stringable version info. 2021-04-02 17:10:06 +09:00
Larry Garfield
069ce7647c
Document Stringable interface 2021-04-01 23:26:42 +02:00
Larry Garfield
3ddc88b836
Note changes in how private methods inherit. (#481) 2021-04-01 23:21:32 +02:00
Christoph M. Becker
9a37893b54
Clarify meaning of stream_get_line() parameters
Cf. <https://bugs.php.net/48421>.

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-04-01 17:33:28 +02:00
Christoph M. Becker
e49940b757
Fix #73938: PHP7 foreach internal array pointer 2021-03-31 16:09:52 +02:00
Christoph M. Becker
c73b00a6d7
Fix #63663: str_word_count does not properly handle non-latin characters
Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-31 15:34:59 +02:00
Christoph M. Becker
4b0cd817ce
PECL/ibase is unmaintained 2021-03-31 15:16:48 +02:00
Tiffany
b60ee4fd0c
fix miscapitalization 2021-03-31 08:12:51 -05:00
sy-records
f03dfae1dc
Add swoole_error_log for swoole and add respective constants
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-31 13:29:14 +02:00
sy-records
e48f15d64a
Add swoole-clear-error for swoole
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-507.
2021-03-31 13:04:05 +02:00
Andreas Braun
876a785f36
MongoDB: Document versioned API functionality 2021-03-31 08:12:45 +02:00
Sara Golemon
b6c8a19a38
Document character class of wrapper scheme names 2021-03-30 15:11:30 +00:00
Deleu
34f9918535
Update documentation related to PHP Tokens
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-474.

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-30 13:01:29 +02:00
Samuel Gfeller
d6cd01d707
Added empty string case to is_numeric code example doc
Closes GH-508.

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-30 12:36:25 +02:00
mikesaintsg
8e2b781577
Update swoole-async-readfile.xml
Grammar correction, "read" is the correct past tense.

Closes GH-504.

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-03-29 13:59:13 +02:00
Michael Vreeken
2b2edac59b Fix typo: shorted -> shorter
Closes GH-502.
2021-03-25 18:32:03 +01:00
rochdiNassah
c630570335 Fix Typo
Closes GH-503.
2021-03-25 18:30:31 +01:00
Martin Samesch
312f9d4e18 fix parameter 2021-03-23 15:25:10 +01:00
George Peter Banyard
b8e1b1357d Some cleanup in FAQ section
Closes GH-327.
2021-03-23 14:19:44 +01:00
Mike Lehan
175b731219 Clarify that Exception::getPrevious may return a Throwable
Spotted this when using PhpStorm's documentation which incorrectly typehints an Exception - use of this as Exception could cause a TypeError if a non-Exception Throwable is returned.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-463.
2021-03-23 14:07:21 +01:00
Kamil Tekiela
4f006f632a Clean up all mysqli aliases removed in PHP 5.4
Closes GH-499.
2021-03-23 13:58:40 +01:00
Kamil Tekiela
9c9b8f3e66 Improve mysqli_query docs
* Add a nice big SQL injection warning

* Break overlong breaks

* Rewrite result_mode explanation

* Simplify examples

* Add mysqli_prepare to see also

Closes GH-497.
2021-03-23 13:53:28 +01:00
Kamil Tekiela
df1072f8d2 Improve mysqli_real_escape_string docs
* Tidy up the alias situation
  It should look the same as https://www.php.net/manual/en/function.mysqli-set-opt.php

* Add "produce" word

Copied from MySQL manual

* Removed old note

  This was changed some time back around PHP 7.3. In PHP 8 all of these warnings have been converted to Errors and the function doesn't return NULL or FALSE anymore.

* Revert Doc Bug #55757

  I'm sorry, but this note doesn't belong here. It is absolutely useless to point it out in this particular place. People migrating from mysql_* API have to do a lot more work than ensuring their escaping function works. This might have been added as a comment, but it should not be part of the official doc page.

* Provide more reasonable example

* Remove mysqli_character_set_name from See also

Closes GH-498.
2021-03-23 13:35:16 +01:00
Cees-Jan Kiewiet
5f6b54fb57 Add FPM access.format placeholders
Closes GH-115.
2021-03-23 13:01:52 +01:00
Kensuke Morii
51ac3ba130 Fix runkit7 functions arg type
runkit7_function_redefine(): Fix type of $is_strict.

runkit7_constant_redefine(): Fix type of $newVisibility.

Closes GH-501.
2021-03-22 18:34:05 +01:00
Kamil Tekiela
34ec8e992f Simplify mysqli select db examples
Closes GH-496.
2021-03-22 17:01:43 +01:00
Gabriel Millian
4bf7d10a44 Fix errors in the comments of example number 6
Closes GH-500.
2021-03-22 16:44:17 +01:00