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

314 Commits

Author SHA1 Message Date
Maurício Meneghini Fauth
cdf59074d3 Replace languages.inc globals with I18n\Languages consts (#1121)
The include/languages.inc file was not removed as it's used in other
repositories. It should be removed after migration.

Tests were added to ensure that the global variables and the constants
are in sync with each other.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-11-14 11:37:00 +03:00
Andreas Möller
9482f9bd43 Fix: Remove unused functions (#585) 2023-12-07 18:14:43 +01:00
Andreas Möller
45d49c7e95 Fix: Remove emacs instruction (#876) 2023-12-07 11:44:39 +00:00
Andreas Möller
c093fb5382 Enhancement: Enable trailing_comma_in_multiline fixer (#647)
* Enhancement: Enable and configure trailing_comma_in_multiline fixer

* Fix: Run 'make coding-standards'
2023-12-06 23:16:28 +00:00
Andreas Möller
a8c736a079 Enhancement: Enable void_return fixer (#661)
* Enhancement: Enable void_return fixer

* Fix: Run 'make coding-standards'
2023-12-05 14:06:29 +01:00
Kamil Tekiela
d4fa469d81 Simplify links (#580) 2022-09-28 15:17:09 +01:00
Andreas Möller
1ebc2c4996 Enhancement: Enable binary_operator_spaces fixer
Closes GH-667.
2022-08-22 19:17:38 +02:00
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
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
Ayesh Karunaratne
d40890db1b Micro Optimizations - Round #2
* .gitignore: Remove redundant entry

* Minor optimizations with ternary operators

* Use `const` instead of `define()` where appropriate

`const` is quite faster because of the compile-time optimizations. Because the replaced statements are not declaring constant conditionally, it's safe to use `const` in all of these places.

Closes GH-608.
2022-07-03 20:33:22 +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
Kamil Tekiela
996c06e1bc Remove old countries lists (#569) 2022-06-28 12:46:27 +01:00
Kamil Tekiela
a6c79eca2e Remove fetch_contents and fetch_header (#566) 2022-06-27 22:49:22 +01:00
George Peter Banyard
b655da2d52 Remove mirroiring stats (#405)
Mirrors have been retired
2021-05-19 14:02:19 -05:00
Sara Golemon
2735e5f03f Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__
1/n - Update / and /include/ only.
2019-05-31 11:19:09 -04:00
Derick Rethans
b2b48ca1e0 Remove references, redirects, and selection of mirrors 2019-04-01 11:27:09 +01:00
Derick Rethans
b02257864c https://www.php.net is the canonical web site address now
This change is needed so that https://www.php.net/git-php.php does not end up
in a redirect loop.
2019-03-25 14:40:16 +00: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
Hannes Magnusson
69702f8d56 Fix XSS reported by Francisco Alonso @ Red Hat Product Security 2014-09-04 14:27:04 -07:00
Adam Harvey
4df6d17ccf Revert "Attempt to fix the php.net cross-domain issues once and for all."
This reverts commit d89cf4ec47.
2014-07-03 09:50:16 -07:00
Adam Harvey
d89cf4ec47 Attempt to fix the php.net cross-domain issues once and for all.
(But this is a terrible hac...)

ONCE AND FOR ALL.
2014-07-02 18:17:31 -07: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
Andreas Heigl
1ac8ba63b8 Optimizes Usergroup-display
This comit adds three things:

1. Support for 2-letter Countrycodes as defined in ISO 3166-1 alpha2.
For that I added a list of country codes from
http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements

2. Caching of retrieved usergroup-information. For that the list of
usergroups as well as the iCalendar-files of the single usergroups are
loaded one every 24 hours into files on the filesystem. those files are
then used for information retrieval

3. Slight optimization of UG-display.
For that I've changed display-style from an unordered to a definition
list. I've also set the date before the meeting-information as that
visually calms the whole list a bit.
2014-03-23 05:42:38 +01:00
Hannes Magnusson
70a4a7f386 Fixed bug #66336 Endless redirect loop on /git-php.php 2013-12-22 11:35:13 -08:00
Hannes Magnusson
b5f9af79fa Logic++ 2013-12-18 11:35:19 -08:00
Hannes Magnusson
14c7b07c47 Hack in https support 2013-12-18 11:31:35 -08:00
Hannes Magnusson
c61c0b9398 Kill STATIC_ROOT, its not helpful. Also use MYSITE for all js/css 2013-12-04 12:10:54 -08:00
Hannes Magnusson
3985d40e3d Arg, Fixed bug #66146 - mirror links wrong 2013-11-22 09:21:50 -08:00
Hannes Magnusson
af21c99842 Download system tweaks
Remove reduntant/duplicate code between do-download and get-download

Also make this page more interesting when the download is missing from
this specific mirror by give the choise of going to other mirrors to check.
Rather then blindly go to the download file though we go to the same page
on the other mirror so we can check if the file exists there before giving
the link to the actual real file.

This also makes it a lot easier to work with on developers checkouts
2013-11-21 11:25:45 -08:00
Hannes Magnusson
9050dae5ab Revert "Remove the filename from BASE_HREF (used for <base />), fixes bug#66138"
This reverts commit cc3a7dccac.
2013-11-21 10:55:09 -08:00
Hannes Magnusson
eec766fe11 Revert "Un-taint the base tag with "./" things :)"
This reverts commit 0bc5a56ab7.
2013-11-21 10:55:05 -08:00
Hannes Magnusson
0bc5a56ab7 Un-taint the base tag with "./" things :) 2013-11-21 10:00:58 -08:00
Hannes Magnusson
cc3a7dccac Remove the filename from BASE_HREF (used for <base />), fixes bug#66138 2013-11-21 09:29:29 -08:00
Hannes Magnusson
703abfd16b Prettify the download page 2013-11-20 14:04:58 -08:00
Ferenc Kovacs
2d5f7af0f3 $MYSITE is www.php.net on the primary site now, so this check(without the www. prefix) would always fail 2013-04-10 00:14:58 +02:00
Daniel P. Brown
3cc9491588 Change multiple checks and references from 'www.php.net' to plainly 'php.net' to reduce 301's, fix a few broken items, and ease a bit of the load off the server (multiple connections per page when statically referenced as 'www.php.net.' 2012-12-05 11:09:23 -05:00
Hannes Magnusson
fbbbe6b072 The CC.php.net has been removed for this array.
Look up the IP in the array (allthough this could give lot of false positives and incorrect sponsoring credits!!)
And if it exists, proceed with the current hostname

This should fix the weird base name the manual pages are getting
2012-10-11 08:39:50 +02:00
Daniel P. Brown
64b4e80525 Nearing the completion of the 'missing sponsor data' bug for the round-robin CC.PHP.NET base. 2012-10-10 15:43:54 -04:00
Hannes Magnusson
cbf00c0299 Add back shorturl to betaweb, and update the canonical version of pages 2011-01-01 21:37:30 +00:00
Hannes Magnusson
c94dfb1a21 I really hate SVN. Remove duplicate features. entry 2011-01-01 20:50:28 +00:00
Hannes Magnusson
afd9bcbb44 feature-? There are no such files, this should 2011-01-01 20:46:12 +00:00
Hannes Magnusson
b6a1709abe Do not overwrite $MYSITE unless the new version actually exists 2010-12-28 11:42:50 +00:00
Philip Olson
05d194f15a 'Temp' fix for a bug on us3.php.net where only curl works... so moving the curl option of fetch_contents() to the top 2010-06-22 22:49:32 +00:00
Philip Olson
c8d3284d5b Added to debugging when using file_get_contents() 2010-05-04 20:15:49 +00:00
Philip Olson
efac7dcb5b Added debugging info to fetch_contents(), and enabled track_errors until we require 5.2+ and/or do better error handling. Reveals too much info? Helps deal with bugs like #51679 2010-05-04 18:08:14 +00:00
Hannes Magnusson
8be460f4db Add support for rev=canonical
# examples:
# http://www.php.net/manual/en/control-structures.continue.php
#  => http://php.net/continue
# http://www.php.net/manual/en/function.strpos.php
#  => http://php.net/strpos
# http://www.php.net/manual/en/language.oop5.overloading.php
# => http://no.php.net/oop5.overloading
2009-04-10 09:50:49 +00:00