1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00
Commit Graph

457 Commits

Author SHA1 Message Date
Andreas Möller
d9bcfed482 Enhancement: Enable array_syntax fixer
Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.
2022-08-22 18:59:14 +02:00
Andreas Möller
f127de5db9 Enhancement: Enable strict_param fixer
We set strict param to false to ensure current behavior,
except for two cases where it is safe to go with true.

Closes GH-658.
2022-07-15 14:48:44 +02:00
Christoph M. Becker
5c9eab2f38 Fix CS violations (case of null, false and true) 2022-07-15 14:05:50 +02:00
Andreas Möller
b575ebd409 Enhancement: Include *.inc files (with exceptions)
Closes GH-662.
2022-07-15 13:57:08 +02:00
Andreas Möller
3a2761d9a4 Fix: Heredoc syntax
Closes GH-564.
2022-07-08 23:29:25 +02:00
Ayesh Karunaratne
1b83fd7ab7 Multiple micro-optimizations
* Replace `ob_get_contents();ob_clean()` with `ob_get_clean()`

`ob_get_clean()` is equivalent to `ob_get_contents()` followed by `ob_clean()`.

* Replace `intval()` calls with `(int)` type cast

This is a micro-optimization because `intval()` is a function call, and the type cast is about 6 times fast.

* Replace `preg_replace` call that could be done with an `rtrim()` call

In `./error.php`, there is a `preg_replace('!/+$!', '', $URI);` call that essentially is equivalent to `rtrim()`, that both calls removing trailing slash characters in `$URI`.
The `rtim()` call is more legible and faster.

* Combine consecutive `str_replace` calls to a single `str_replace` call

* Use short ternary operator where possible

Improves code readability.

* Cascade various `else` statements where possible

Cleans up the code by removing unnecessary `else` blocks and moving the code to the parent context if the previous `if` block exits the function by either terminating the script, or with a `return` statement.

* Combine multiple `isset()` calls to a single `isset()`

`isset()` accepts multiple parameters and returns `true` only if all of the parameters are `isset`. It makes sense to combine multiple individual `isset` calls to a single call for better readability.

* Replace `for` loop with a `foreach` loop

* Remove unnecessary character escapes in regular expressions

Regular expression special characters are context-sensitive. For example, special characters such as `.` are not considered special within square braces (`[]`).
This removes several of such instances that certain characters are escaped, but it is not strictly necessary within the context. This improves the readability of the expression.

See more information at [PHP.Watch: Writing better Regular Expressions in PHP](https://php.watch/articles/php-regex-readability#reduce-escape)

* Remove unnecessary break statement

* Remove unnecessary PHP close tags

* Remove redundant JSON_ERROR_NONE check

Remove unnecessary `json_last_error() == JSON_ERROR_NONE` where the decoded object is inspected already.

Closes GH-603.
2022-07-03 12:24:14 +02:00
Andreas Möller
c73856319c Remove arguments identical to default values of parameters
Closes GH-583.
2022-06-28 18:51:03 +02:00
Andreas Möller
879d410643 Inline unnecessary local variables
Closes GH-582.
2022-06-28 18:47:39 +02:00
Andreas Möller
5e659e0dc4 Fix: Remove parameter where argument is never specified
Closes GH-573.
2022-06-28 14:40:31 +02:00
Andreas Möller
30796f6f06 Fix: Remove unused parameter
Closes GH-571.
2022-06-28 14:32:24 +02:00
Andreas Möller
1c2bd8ad42 Fix: Remove unused parameter
Closes GH-572.
2022-06-28 14:27:56 +02:00
Andreas Möller
22fffaad7a Fix: Remove unused references to a global variable (#563) 2022-06-28 13:20:52 +01:00
Mike Schinkel
01337ed193 Remove use of get_magic_quotes_gpc()
As get_magic_quotes_gpc() has been removed in PHP 8.0, this PR removes it from the clean() function in layout.inc.

Closes GH-419.
2021-07-24 00:39:15 +02:00
Mike Schinkel
0cea658a5e Add returns to end of functions (#422)
PhpStorm flags functions that don't have returns at the end so this PR rearranges code so that the returns are always at the end, or in one case adds one that was missing.
2021-07-21 21:20:10 +02:00
Sara Golemon
ae006c3288 Migrate away from strftime 2021-07-05 14:55:45 +00:00
Sara Golemon
ca283e8c03 Remove defunct usergroup pages 2021-04-18 23:23:55 +00:00
Sara Golemon
8249f7f58f Revert "Temporary hacky fix for cache issue and old 8.0.2 tarballs"
This reverts commit 2e0a93ef3f.

The caching issue has expired and we now resume our regularly scheduled programming.
2021-02-05 15:36:57 +00:00
Sara Golemon
2e0a93ef3f Temporary hacky fix for cache issue and old 8.0.2 tarballs 2021-02-04 16:50:18 +00:00
Sara Golemon
f8d7a46022 Refactor php8 announcement helpers into common include file 2020-11-27 14:59:12 +00:00
daijie
99eb762527 Translate php 8.0 release page to Chinese Simplified
Closes GH-363
2020-11-27 14:45:39 +00:00
George Peter Banyard
f2407335ed French translation of the PHP 8 announcement page 2020-11-26 19:11:58 +00:00
Roman Pronskiy
bf8ae9d5a3 Update include/layout.inc
Co-authored-by: Gabriel Caruso <carusogabriel34@gmail.com>
2020-11-25 20:28:13 +00:00
Roman Pronskiy
ddaa6d358b Drop Dutch translation because switch does not work 2020-11-25 20:28:13 +00:00
Enno Woortmann
55e6e15981 Translate PHP 8 announcement to german (#2)
Co-authored-by: Roman Pronskiy <root@pronskiy.com>
2020-11-25 20:28:13 +00:00
SjonHortensius
08f66f3ae7 add dutch translation for PHP8 splash page (#3)
* add dutch translation for PHP8 splash page

* fix some typos and reword some things

Co-authored-by: Roman Pronskiy <root@pronskiy.com>
2020-11-25 20:28:13 +00:00
Alexander Makarov
98fb4d42ce Remove unused code 2020-11-25 20:28:13 +00:00
Alexander Makarov
f9fbd33030 Remove dead code 2020-11-25 20:28:13 +00:00
Roman Pronskiy
25b3d36fe1 Add highlighting for code blocks 2020-11-25 20:28:13 +00:00
Roman Pronskiy
580ebcc465 Add pt_BR page fro PHP 8 release 2020-11-25 20:28:13 +00:00
Roman Pronskiy
3dd619f3bb Move lang chooser to a function 2020-11-25 20:28:13 +00:00
Peter Cowburn
5223f48cbe Curly braces for string offset access are deprecated 2020-02-05 20:40:49 +00:00
Sara Golemon
aad64a2d07 Preserve absolute href when stripping host. 2019-07-24 11:22:15 -04:00
Peter Cowburn
39daeda954 use updated "Strip http://php.net" method for more news links
Following on from a similar change in 47f8ecc688, update more places
where we manipulate the URL.
2019-07-23 20:07:25 +01:00
Derick Rethans
b2b48ca1e0 Remove references, redirects, and selection of mirrors 2019-04-01 11:27:09 +01:00
Peter Kokot
b5edd2d17b Change dirname(__FILE__) to shorter __DIR__ 2018-10-23 17:30:55 +02:00
Peter Kokot
dd8d8bf863 Sync final and leading newlines
This patch adds some missing newlines, trims some multiple redundant
final newlines into a single one, and trims few 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-17 12:37:26 +02:00
Peter Kokot
e235f79473 Trim trailing whitespace
This patch cleans all redundant trailing whitespace across the
repository except for the icalendar files.
2018-10-17 10:51:08 +02:00
Peter Kokot
0f95b8c709 Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-10-17 07:29:46 +02:00
Adam Harvey
4c768cf0f8 Update the 2017 archive to always show everything.
This also removes the $vevent appendix in print_news(), whereby we
walked every category even if we'd already found our match to set
$vevent, then didn't use it again because it wasn't needed in the new
design. That should fix global warming.
2017-06-08 11:19:49 -07:00
Scott
77089b5ed9 Parse HTTPS urls as well 2015-10-05 20:02:36 -07:00
Hannes Magnusson
d3d5ba6fb0 Fix markdown syntax highlighting 2015-04-30 10:10:18 -07:00
Hannes Magnusson
8b26df29fb Avoid unset error on some pages, likely do-download pages?
This is causing lots of notices in the www error logs :)
2015-02-03 11:50:27 -08:00
Hannes Magnusson
e437f8ce41 remove unused function 2015-02-03 11:48:28 -08:00
Anthony Ferrara
686c4181e3 Fix potential file-include vulnerability
Fix potential file-include vulnerability by adding `EXTR_SKIP` to extract so it doesn't overwrite `$params` array.
2015-01-20 16:10:19 -05:00
Michael
27628e547a Use css class instead inline style 2014-06-06 23:55:53 +02:00
Michael
d766dd3c67 Drop support for < 5.3 from highlight_php()
...to use HTML5
2014-06-05 19:57:40 +02:00
Michael
113c86286d Also remove XHTML from .inc files 2014-06-04 19:50:50 +02:00
Hannes Magnusson
468b736548 Always use 3letter country codes - except when parsing usergroups.js
This quickfixes invalid flags, default listing, links, and makes it consistent with the rest of
the site
2014-03-28 00:24:21 -07:00
Hannes Magnusson
9eddd61629 Merge pull request #35 from heiglandreas/feature/addUgFromLiveData
Optimizes Usergroup-display

* heiglandreas/feature/addUgFromLiveData:
  Removes unnecessary code
  Optimizes Usergroup-display
2014-03-26 07:20:56 -07:00
Andreas Heigl
3e0eb4f6e3 Removes unnecessary code 2014-03-24 07:15:27 +01:00