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

39 Commits

Author SHA1 Message Date
Andreas Möller
110813107f Enhancement: Enable unary_operator_spaces fixer (#851)
* Enhancement: Enable unary_operator_spaces fixer

* Fix: Run 'make coding-standards'
2023-12-06 03:57:58 +00: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
b575ebd409 Enhancement: Include *.inc files (with exceptions)
Closes GH-662.
2022-07-15 13:57:08 +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
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
Andreas Heigl
7be864b190 Adapts the validation to use filter_var
Everything else is then simply refinement
2017-08-17 18:44:27 +02:00
Andreas Heigl
c716ac3b05 Alters email-verification
The current email-verification is completely based on regex that is not
up-to-date any more in regard to newer TLDs. For example the current
version checks whether the TLD is between 2 and 6 chars long which fails
for ".digital" and some other longer TLDs

I've altered it so that the host-check is done by actually checking for
an MX-record so host that currently validate against the regex will fail
in future when no MX is available.

The Address-Part is still matched against a Regex.
2017-08-17 07:15:01 +02:00
danbrown
ed25fb4de8 More mosquitoes to be swatted. 2016-05-13 11:38:49 -04:00
Christoph M. Becker
5cda0b8979 fix blacklisted() to treat $mosquitoes as literals (not regexps) 2015-05-28 19:57:28 -07:00
danbrown
d5032adb12 Adding onto the spammer array.... 2015-04-23 13:45:53 -04:00
danbrown
52d14941ce Wow. Lots of junk in the event submission trunk today. 2014-12-18 11:08:46 -05:00
danbrown
d3c80299a6 Another pesky mosquito.... 2014-08-21 09:30:13 -04:00
danbrown
815774f318 Bloody mosquitoes.... 2014-01-03 12:11:38 -05:00
danbrown
7771eba9fa Still more of those darn BIT and ISIM mosquitoes. 2013-08-27 15:34:59 -04:00
danbrown
e280357042 Still more mosquitoes.... 2013-06-04 14:03:23 -04:00
Daniel P. Brown
858e55d9aa Another mosquito. This one, Moroccan. A-Hassani, the Moroccan Mosquito. Sounds like a superhero. 2013-04-10 11:30:05 -04:00
Daniel P. Brown
2dca309444 Another mosquito.... 2013-03-01 16:40:07 -05:00
Daniel P. Brown
c4cb7b9098 Yet another 'BIT' mosquito.... 2013-01-18 14:34:06 -05:00
Daniel P. Brown
083185d3fc More mosquitoes.... 2013-01-08 11:44:07 -05:00
Daniel P. Brown
112083a351 Buzzzzz-bzz-bzzzzzzzzzzzzzzzzzzzz.... SWAT\! 2012-11-07 14:21:55 -05:00
Daniel P. Brown
5d58098da6 Ten more 'mosquitoes.' There were about 35 new SPAM events of 97 total entries this time. Neat. 2012-10-03 12:08:20 -04:00
Adam Harvey
847a948b9c Add cogzidel to the mosquito list (and fix the indentation on said list), per Daniel's request. 2012-09-12 13:18:47 +08:00
Daniel P. Brown
2678a6ff83 More lovely SPAM.... 2012-03-15 16:41:47 -04:00
Daniel P. Brown
a1ebb433de Still more of these lovely SPAM-sending folks.... 2012-02-27 10:43:03 -05:00
Daniel P. Brown
be9e61789e Yet another bitlife* alias. Persistent little buggers.... 2012-02-16 11:44:37 -05:00
Daniel P. Brown
7542e119fc Yet another event spammer. 2012-01-09 17:41:17 +00:00
Daniel P. Brown
1e3bff8041 Just removed no less than forty (40) SPAM 'training' entries on the calendar. 2012-01-03 21:43:19 +00:00
Daniel P. Brown
b767dc5d4f Another one to bite the dust. 2011-10-03 13:16:24 +00:00
Daniel P. Brown
60846759fc To stop events such as 5008, 5009, and 5010. 2011-09-26 15:04:41 +00:00
Daniel P. Brown
77621cef87 Slightly improved address and domain-matching SPAM prevention mechanism. 2011-08-22 13:33:56 +00:00
Gabor Hojtsy
9db679930b tabs to spaces 2004-10-11 14:16:32 +00:00
Gabor Hojtsy
6943eed5e3 Use pregs instead of eregs for consistency and make the code
more readable
2003-08-09 12:16:08 +00:00
jim winstead
904c3f1d3c deal with new long tlds 2002-01-30 18:33:56 +00:00
Gabor Hojtsy
290b36d2ca Cosmetics done in the include dir too :)) 2001-07-08 13:06:38 +00:00
Jesus M. Castagnetto
e07a66b1e4 Simplified validation, w/o using getmxrr(). We just need to be more careful
when editing the notes :-)
2001-03-01 01:07:46 +00:00
Jesus M. Castagnetto
16faa8bd95 Modified email validation function to print out debugging info.
Added testing script: check_email_func.php, when used as:
http://www.php.net/include/chec_email_func.php?debug=1
it will do the validation with a set of email addresses and
print out debugging info.
2001-02-28 11:55:51 +00:00
Jesus M. Castagnetto
4deabdbd59 s/check/chek/ in email checking regex 2000-10-23 01:13:07 +00:00
Jesus M. Castagnetto
9c6a5eb52d Email address validation function (uses M. Lemos class) for the
"reject" option of the Notes administration
2000-10-23 00:52:20 +00:00