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

70 Commits

Author SHA1 Message Date
Derick Rethans
7023ed3872 Remove country detection from IP
The database that this depended on hasn't been available for quite some time now.
2024-11-27 12:27:27 +01:00
Mathias Reker ⚡️
fd62baa267 List syntax (#529)
List (array destructuring) assignment should be declared using the configured syntax.
2023-08-29 11:20:33 +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
57f505ed58 Enhancement: Enable and configure concat_space fixer
Closes GH-657.
2022-08-22 19:04:47 +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
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
Andreas Möller
d7e1b8159c Enhancement: Enable constant_case fixer
Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-660.
2022-07-15 13:50:13 +02:00
Andreas Möller
c68e5a9e4a Enhancement: Enable single_space_after_construct fixer
Closes GH-640.
2022-07-12 11:44:23 +02:00
Mathias Reker ⚡️
73f3c628fd Combine consecutive unsets (#543) 2022-07-05 15:01:39 +01: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
4e251d6993 Remove duplicated !isset($var) (#570) 2022-06-28 12:45:50 +01:00
Mathias Reker ⚡️
530b28e95b Add void return types
Add void return type to functions with missing or empty return statements.

Closes GH-535.
2022-06-17 19:16:52 +02:00
Sara Golemon
ae006c3288 Migrate away from strftime 2021-07-05 14:55:45 +00: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
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
Michael
5bfef25e70 Kill off XHTML
Long live HTML5! =)
2014-06-04 19:39:27 +02:00
Levi Morrison
72e6b7738d Added option to site_header to allow a custom span(for twitter bootstrap). Calendar page needed this. Other minor updates. 2013-07-10 15:31:16 -06:00
Adam Harvey
0f25c08b5e Stop abusing the current element of the page configuration, and instead add a
proper option to set body classes if appropriate.
2012-09-07 16:34:28 +08:00
Adam Harvey
e61828f07a Add calendar styling: this isn't perfect, but it's a tonne better than what we
had, which was nothing.
2012-08-31 17:56:36 +08:00
Hannes Magnusson
60d5c3b903 Add current config option (ignored in old-web), and FIXME placeholders for pages
not in any menu yet
2010-12-28 11:09:09 +00:00
Adam Harvey
a74b0895b9 Fix bug #52204 (htmlentities E_WARNINGs). Patch by Kalle. 2010-10-29 12:08:16 +00:00
Hannes Magnusson
b41ebd4228 entitify quotes and use utf8 (patch by Johannes) 2007-06-04 16:57:57 +00:00
Gabor Hojtsy
f4fc2363ff allow a year ahead to be displayed 2003-12-31 13:04:27 +00:00
Gabor Hojtsy
d14c7cb10f The CSS validator don't seem to like _ in a classname, so avoid
that, and also use a more appropriate cat# naming, as we refer
to categories here
2003-08-16 12:32:02 +00:00
Gabor Hojtsy
69a019d366 Add category class to event links, so we will be able to color them
differently, and also drop the BC code for 12 data elements, as we
always have 13 now for all events
2003-08-15 10:30:44 +00:00
Gabor Hojtsy
7b4634bc7a Do not depend on strict violating bgcolor specifications, and
also remove the need for register_globals with direct linking
2003-08-14 21:55:46 +00:00
Gabor Hojtsy
e30ed1aa3d Migrate more pages to use the new header and footer functions 2003-08-14 11:56:42 +00:00
Gabor Hojtsy
eeafa72a9a Apply new include and base page code
Use _GET instead of depending on register_globals
2003-08-09 14:44:41 +00:00
Rasmus Lerdorf
2fccf6c82b Uh, forgot to run php -l on this one 2003-06-01 15:54:23 +00:00
Rasmus Lerdorf
ddc3732b3b More work on the event categorization 2003-06-01 15:52:37 +00:00
Gabor Hojtsy
f1dd4aaa39 Display local events in bold on the calendar page too
Also polish the display_event function and print out
the country information too about the event in brackets
2003-05-12 11:48:36 +00:00
Gabor Hojtsy
a5d5ab8758 Only allow the same year. The events.cvs file only contains data for
this month and the coming two months, starting from today, so providing
information for the future or the past is only an illusion. Only the
recurring events are displayed on those pages, so there is no point in
serving them.
2003-01-15 17:04:21 +00:00
Gabor Hojtsy
44bf48e753 Introduce the limit for year values. Two years back
is allowed for historical reasons, two years forward
is allowed for those organizers who know two years in
advance, what they will present...

This should make the cal page indexable by local search
engines too...
2002-12-16 17:25:10 +00:00
Gabor Hojtsy
bf59c32a11 New, commented version of cal.php
- Indentation standardisation
  - Added several comments
  - Made some file reads and variable
    checks more error-proof, so it gracely
    degrades from more problematic situations

Still nothing done about year problems, I am on it...

Goba
2002-12-16 17:03:23 +00:00
Rasmus Lerdorf
3e63cfad20 Make cal.php E_NOTICE clean 2002-11-22 18:19:13 +00:00
Simone Cortesi
9a84c4eea7 fixing bug 17796: slash problem on calendar 2002-06-19 00:46:09 +00:00
jim winstead
5ca715d696 be less hamhanded about fixing xss problem. 2002-05-02 18:09:47 +00:00
James Cox
164b1a1dc7 /me grumbles something about people not having anything better to do 2002-05-02 05:45:19 +00:00
jim winstead
222ff1f075 rewrote cal.php to get data from backend/events.csv. phpweb is once again
mysql-free. also got rid of events.php, since cal.php can now display info
about particular events. the calendar should look essentially the same, modulo
smaller default text, and some small css tweaks (mainly to put a divider
between events -- i could never tell them apart before).

one small thing to add would be a remove button to events a-la the
manual notes when the magic cookie is set.
2002-03-05 02:54:19 +00:00
jim winstead
5dac60f00a strip out event adding/editing. lives in submit-event.php and on master.php.net now. 2002-03-04 21:22:08 +00:00
Georg Richter
59a1cdfb85 Fixed bug #15640 (non closing th,td,tr) 2002-02-20 07:27:00 +00:00
James Cox
217d89f1de emacs adds whitespace - at least for when i use it. 2002-01-28 21:56:15 +00:00
James Cox
aa558b57b9 new fields to the calender. Changes primarily by georg@php.net - Georg Richter.
Blame him if it breaks :)
2002-01-28 21:53:06 +00:00
jim winstead
d45a530b1d fix insert queries. 2002-01-28 21:25:13 +00:00
jim winstead
d8ee027a52 use is_primary_site() function 2002-01-09 00:48:38 +00:00
Gabor Hojtsy
c514283aab A reciprocal location redirect was corrected. A mirror
realized, that he is not the primary site, then redirected
to php2.chek.com, but that is again not the primary site,
so redirected to php2.chek.com and so on... Now test for
php2.chek.com
2001-12-22 12:27:44 +00:00
Rasmus Lerdorf
ac9ded680d Run cal.php from php2.chek.com 2001-12-03 07:17:47 +00:00
jim winstead
f13093c8e8 more fixes for backup primary 2001-09-19 18:04:02 +00:00
Gabor Hojtsy
697f8d47b6 At least stop that error message 2001-09-19 16:25:49 +00:00