diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index c3be35e958..e32ce2808a 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -33,6 +33,7 @@
],
'indentation_type' => true,
'line_ending' => true,
+ 'method_argument_space' => true,
'new_with_parentheses' => true,
'no_extra_blank_lines' => true,
'no_trailing_whitespace' => true,
diff --git a/ChangeLog-8.php b/ChangeLog-8.php
index da96c9eb37..0250244066 100644
--- a/ChangeLog-8.php
+++ b/ChangeLog-8.php
@@ -2737,19 +2737,19 @@
- Core:
- - Fixed bug (Intel CET is disabled unintentionally).
+ - Fixed bug (Intel CET is disabled unintentionally).
- Fixed leak in Enum::from/tryFrom for internal enums when using JIT
- Fixed calling internal methods with a static return type from extension code.
- - Fixed bug (Casting an object to array does not unwrap refcount=1 references).
+ - Fixed bug (Casting an object to array does not unwrap refcount=1 references).
- Fixed potential use after free in php_binary_init().
- CLI:
- - Fixed (Intentionally closing std handles no longer possible).
+ - Fixed (Intentionally closing std handles no longer possible).
- COM:
- - Fixed bug (Integer arithmethic with large number variants fails).
+ - Fixed bug (Integer arithmethic with large number variants fails).
- Curl:
@@ -2778,7 +2778,7 @@
- mb_detect_encoding recognizes all letters in Czech alphabet
- mb_detect_encoding recognizes all letters in Hungarian alphabet
- - Fixed bug (pcre not ready at mbstring startup).
+ - Fixed bug (pcre not ready at mbstring startup).
- Backwards-compatible mappings for 0x5C/0x7E in Shift-JIS are restored, after they had been changed in 8.1.0.
- ODBC:
@@ -2787,7 +2787,7 @@
OPcache:
- - Fixed bug (tracing JIT crash after private instance method change).
+ - Fixed bug (tracing JIT crash after private instance method change).
OpenSSL:
Zip:
- - Fixed bug (ZipArchive::close deletes zip file without updating stat cache).
+ - Fixed bug (ZipArchive::close deletes zip file without updating stat cache).
@@ -2812,7 +2812,7 @@
- CLI:
- - Fixed bug (CLI closes standard streams too early).
+ - Fixed bug (CLI closes standard streams too early).
- Date:
@@ -2821,7 +2821,7 @@
- (DateTime object does not support short ISO 8601 time format - YYYY-MM-DDTHH)
- (Timezones and offsets are not properly used when working with dates)
- (date parsing fails when provided with timezones including seconds).
- - Fixed bug (Problems with negative timestamps and fractions).
+ - Fixed bug (Problems with negative timestamps and fractions).
- FPM:
- OPcache:
- - Fixed bug (tracing JIT crash after function/method change).
+ - Fixed bug (tracing JIT crash after function/method change).
- OpenSSL:
- Soap:
- - Fixed bug (Error on wrong parameter on SoapHeader constructor).
- - Fixed bug (SoapClient may strip parts of nmtokens).
+ - Fixed bug (Error on wrong parameter on SoapHeader constructor).
+ - Fixed bug (SoapClient may strip parts of nmtokens).
- SPL:
- - Fixed bug (iterator_count() may run indefinitely).
+ - Fixed bug (iterator_count() may run indefinitely).
- Standard:
- - Fixed bug (Crash during unloading of extension after dl() in ZTS).
+ - Fixed bug (Crash during unloading of extension after dl() in ZTS).
- Zip:
@@ -2875,21 +2875,21 @@
- Core:
- - Fixed bug (Registry settings are no longer recognized).
+ - Fixed bug (Registry settings are no longer recognized).
- Fixed potential race condition during resource ID allocation.
- - Fixed bug (Preloading of constants containing arrays with enums segfaults).
+ - Fixed bug (Preloading of constants containing arrays with enums segfaults).
- Fixed Haiku ZTS builds.
- Date:
- - Fixed bug (DateTimeZone::getTransitions() returns insufficient data).
- - Fixed bug (Timezone doesn't work as intended).
+ - Fixed bug (DateTimeZone::getTransitions() returns insufficient data).
+ - Fixed bug (Timezone doesn't work as intended).
- (DateTimeZone::getTransitions() returns invalid data).
- - Fixed bug (Exceptions thrown within a yielded from iterator are not rethrown into the generator).
+ - Fixed bug (Exceptions thrown within a yielded from iterator are not rethrown into the generator).
- FFI:
- - Fixed bug (Assigning function pointers to structs in FFI leaks).
+ - Fixed bug (Assigning function pointers to structs in FFI leaks).
- FPM:
- Iconv:
- - Fixed bug (ob_end_clean does not reset Content-Encoding header).
+ - Fixed bug (ob_end_clean does not reset Content-Encoding header).
- Intl:
- - Fixed bug (msgfmt_format $values may not support references).
+ - Fixed bug (msgfmt_format $values may not support references).
- MBString:
- MySQLi:
- - Fixed bug (MySQLi uses unsupported format specifier on Windows).
+ - Fixed bug (MySQLi uses unsupported format specifier on Windows).
- SPL:
- - Fixed bug (ArrayIterator may leak when calling __construct()).
- - Fixed bug (SplFileObject: key() returns wrong value).
+ - Fixed bug (ArrayIterator may leak when calling __construct()).
+ - Fixed bug (SplFileObject: key() returns wrong value).
- Streams:
- zlib:
- - Fixed bug (ob_end_clean does not reset Content-Encoding header).
+ - Fixed bug (ob_end_clean does not reset Content-Encoding header).
@@ -2940,10 +2940,10 @@
- Core:
- - Fixed bug (Enum values in property initializers leak).
+ - Fixed bug (Enum values in property initializers leak).
- Fixed freeing of internal attribute arguments.
- - Fixed bug (memory leak of internal function attribute hash).
- - Fixed bug (ZTS support on Alpine is broken).
+ - Fixed bug (memory leak of internal function attribute hash).
+ - Fixed bug (ZTS support on Alpine is broken).
- Filter:
- Intl:
- - Fixed bug (Can't catch arg type deprecation when instantiating Intl classes).
- - Fixed bug (Compilation error on cygwin).
- - Fixed bug (Fix IntlPartsIterator key off-by-one error and first key).
+ - Fixed bug (Can't catch arg type deprecation when instantiating Intl classes).
+ - Fixed bug (Compilation error on cygwin).
+ - Fixed bug (Fix IntlPartsIterator key off-by-one error and first key).
- MBString:
- - Fixed bug (mb_encode_mimeheader: $indent functionality broken).
+ - Fixed bug (mb_encode_mimeheader: $indent functionality broken).
- MySQLi:
- - Fixed bug (mysqli_fetch_object creates inaccessible properties).
+ - Fixed bug (mysqli_fetch_object creates inaccessible properties).
- Pcntl:
- - Fixed bug (Compilation error on cygwin).
+ - Fixed bug (Compilation error on cygwin).
- PgSQL:
- Fixed result_type related stack corruption on LLP64 architectures.
- - Fixed bug (pg_insert() fails for references).
+ - Fixed bug (pg_insert() fails for references).
- Sockets:
- SPL:
- - Fixed bug (SplFileObject - seek and key with csv file inconsistent).
- - Fixed bug (Cannot override DirectoryIterator::current() without return typehint in 8.1).
+ - Fixed bug (SplFileObject - seek and key with csv file inconsistent).
+ - Fixed bug (Cannot override DirectoryIterator::current() without return typehint in 8.1).
- Standard:
- - Fixed bug (Force macOS to use statfs).
+ - Fixed bug (Force macOS to use statfs).
@@ -2996,12 +2996,12 @@
- Core:
- Fixed Haiku ZTS build.
- - Fixed bug arginfo not regenerated for extension.
- - Fixed bug Segfault when dumping uncalled fake closure with static variables.
- - Fixed bug (Nested CallbackFilterIterator is leaking memory).
- - Fixed bug (Wrong type inference of range() result).
- - Fixed bug (Wrong first class callable by name optimization).
- - Fixed bug (op_arrays with temporary run_time_cache leak memory when observed).
+ - Fixed bug arginfo not regenerated for extension.
+ - Fixed bug Segfault when dumping uncalled fake closure with static variables.
+ - Fixed bug (Nested CallbackFilterIterator is leaking memory).
+ - Fixed bug (Wrong type inference of range() result).
+ - Fixed bug (Wrong first class callable by name optimization).
+ - Fixed bug (op_arrays with temporary run_time_cache leak memory when observed).
- GD:
- Iconv:
- - Fixed bug (ob_clean() only does not set Content-Encoding).
- - Fixed bug (Unexpected result for iconv_mime_decode).
+ - Fixed bug (ob_clean() only does not set Content-Encoding).
+ - Fixed bug (Unexpected result for iconv_mime_decode).
- MBString:
- - Fixed bug (mb_check_encoding wrong result for 7bit).
+ - Fixed bug (mb_check_encoding wrong result for 7bit).
- MySQLnd:
- - Fixed bug (NULL pointer dereference in mysqlnd package).
+ - Fixed bug (NULL pointer dereference in mysqlnd package).
- Reflection:
- - Fixed bug (ReflectionClass::getConstants() depends on def. order).
+ - Fixed bug (ReflectionClass::getConstants() depends on def. order).
- Zlib:
- - Fixed bug (ob_clean() only does not set Content-Encoding).
+ - Fixed bug (ob_clean() only does not set Content-Encoding).
@@ -3043,12 +3043,12 @@
- Core:
- (Attribute instantiation leaves dangling pointer).
- - Fixed bug (Environment vars may be mangled on Windows).
- - Fixed bug (Segfault when INI file is not readable).
+ - Fixed bug (Environment vars may be mangled on Windows).
+ - Fixed bug (Segfault when INI file is not readable).
- FFI:
- - Fixed bug (FFI::cast() from pointer to array is broken).
+ - Fixed bug (FFI::cast() from pointer to array is broken).
- Filter:
@@ -3057,15 +3057,15 @@
- FPM:
- Fixed memory leak on invalid port.
- - Fixed bug (Invalid OpenMetrics response format returned by FPM status page.
+ - Fixed bug (Invalid OpenMetrics response format returned by FPM status page.
- MBString:
- - Fixed bug (mb_send_mail may delimit headers with LF only).
+ - Fixed bug (mb_send_mail may delimit headers with LF only).
- MySQLnd:
- - Fixed bug (MariaDB version prefix 5.5.5- is not stripped).
+ - Fixed bug (MariaDB version prefix 5.5.5- is not stripped).
- pcntl:
- Sockets:
- - Fixed bug (sockets extension compilation errors).
+ - Fixed bug (sockets extension compilation errors).
- Standard:
- - Fixed bug (Regression in unpack for negative int value).
- - Fixed bug (mails are sent even if failure to log throws exception).
+ - Fixed bug (Regression in unpack for negative int value).
+ - Fixed bug (mails are sent even if failure to log throws exception).
@@ -3095,7 +3095,7 @@
- (GCC-11 silently ignores -R).
- (Misleading "access type ... must be public" error message on final or abstract interface methods).
- (cached_chunks are not counted to real_size on shutdown).
- - Fixed bug (Multi-inherited final constant causes fatal error).
+ - Fixed bug (Multi-inherited final constant causes fatal error).
- Fixed zend_fibers.c build with ZEND_FIBER_UCONTEXT.
- Added riscv64 support for fibers.
@@ -3105,8 +3105,8 @@
Hash:
- - Fixed bug (Incorrect return types for hash() and hash_hmac()).
- - Fixed bug (Inconsistent argument name in hash_hmac_file and hash_file).
+ - Fixed bug (Incorrect return types for hash() and hash_hmac()).
+ - Fixed bug (Inconsistent argument name in hash_hmac_file and hash_file).
MBString:
@@ -3116,7 +3116,7 @@
- (MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in MariaDB).
- Introduced MYSQLI_IS_MARIADB.
- - Fixed bug (mysqli_sql_exception->getSqlState()).
+ - Fixed bug (mysqli_sql_exception->getSqlState()).
MySQLnd:
OCI8:
- - Fixed bug (php_oci_cleanup_global_handles segfaults at second call).
+ - Fixed bug (php_oci_cleanup_global_handles segfaults at second call).
OPcache:
@@ -3150,12 +3150,12 @@
- Spl:
- (SplFileObject::seek broken with CSV flags).
- - Fixed bug (Cloning a faked SplFileInfo object may segfault).
+ - Fixed bug (Cloning a faked SplFileInfo object may segfault).
- Standard:
- - Fixed bug (gethostbyaddr outputs binary string).
- - Fixed bug (php_uname doesn't recognise latest Windows versions).
+ - Fixed bug (gethostbyaddr outputs binary string).
+ - Fixed bug (php_uname doesn't recognise latest Windows versions).
@@ -3742,11 +3742,11 @@
CLI:
- - Fixed (Intentionally closing std handles no longer possible).
+ - Fixed (Intentionally closing std handles no longer possible).
COM:
- - Fixed bug (Integer arithmethic with large number variants fails).
+ - Fixed bug (Integer arithmethic with large number variants fails).
Curl:
MBString:
- - Fixed bug (pcre not ready at mbstring startup).
+ - Fixed bug (pcre not ready at mbstring startup).
ODBC:
Zip:
- - Fixed bug (ZipArchive::close deletes zip file without updating stat cache).
+ - Fixed bug (ZipArchive::close deletes zip file without updating stat cache).
@@ -3794,7 +3794,7 @@
- CLI:
- - Fixed bug (CLI closes standard streams too early).
+ - Fixed bug (CLI closes standard streams too early).
- Core:
- Date:
- - Fixed bug (Segmentation fault when converting immutable and mutable DateTime instances created using reflection).
+ - Fixed bug (Segmentation fault when converting immutable and mutable DateTime instances created using reflection).
- FPM:
- OPcache:
- - Fixed bug (ini_get() is optimized out when the option does not exist).
+ - Fixed bug (ini_get() is optimized out when the option does not exist).
- Pcntl:
- Soap:
- - Fixed bug (Error on wrong parameter on SoapHeader constructor).
- - Fixed bug (SoapClient may strip parts of nmtokens).
+ - Fixed bug (Error on wrong parameter on SoapHeader constructor).
+ - Fixed bug (SoapClient may strip parts of nmtokens).
- SPL:
- - Fixed bug (iterator_count() may run indefinitely).
+ - Fixed bug (iterator_count() may run indefinitely).
- Zip:
@@ -3848,15 +3848,15 @@
- Core:
- - Fixed bug (Exceptions thrown within a yielded from iterator are not rethrown into the generator).
+ - Fixed bug (Exceptions thrown within a yielded from iterator are not rethrown into the generator).
- Date:
- - Fixed bug (DatePeriod iterator advances when checking if valid).
+ - Fixed bug (DatePeriod iterator advances when checking if valid).
- FFI:
- - Fixed bug (Assigning function pointers to structs in FFI leaks).
+ - Fixed bug (Assigning function pointers to structs in FFI leaks).
- FPM:
- Iconv:
- - Fixed bug (ob_end_clean does not reset Content-Encoding header).
+ - Fixed bug (ob_end_clean does not reset Content-Encoding header).
- Intl:
- - Fixed bug (msgfmt_format $values may not support references).
+ - Fixed bug (msgfmt_format $values may not support references).
- MySQLi:
- - Fixed bug (MySQLi uses unsupported format specifier on Windows).
+ - Fixed bug (MySQLi uses unsupported format specifier on Windows).
- SPL:
- - Fixed bug (ArrayIterator may leak when calling __construct()).
- - Fixed bug (SplFileObject: key() returns wrong value).
+ - Fixed bug (ArrayIterator may leak when calling __construct()).
+ - Fixed bug (SplFileObject: key() returns wrong value).
- Streams:
- zlib:
- - Fixed bug (ob_end_clean does not reset Content-Encoding header).
+ - Fixed bug (ob_end_clean does not reset Content-Encoding header).
@@ -3900,8 +3900,8 @@
- Core:
- Fixed freeing of internal attribute arguments.
- - Fixed bug (memory leak of internal function attribute hash).
- - Fixed bug (ZTS support on Alpine is broken).
+ - Fixed bug (memory leak of internal function attribute hash).
+ - Fixed bug (ZTS support on Alpine is broken).
- Filter:
- Intl:
- - Fixed bug (Compilation error on cygwin).
+ - Fixed bug (Compilation error on cygwin).
- MBString:
- - Fixed bug (mb_encode_mimeheader: $indent functionality broken).
+ - Fixed bug (mb_encode_mimeheader: $indent functionality broken).
- MySQLi:
- - Fixed bug (mysqli_fetch_object creates inaccessible properties).
+ - Fixed bug (mysqli_fetch_object creates inaccessible properties).
- Pcntl:
- - Fixed bug (Compilation error on cygwin).
+ - Fixed bug (Compilation error on cygwin).
- PgSQL:
- Fixed result_type related stack corruption on LLP64 architectures.
- - Fixed bug (pg_insert() fails for references).
+ - Fixed bug (pg_insert() fails for references).
- Sockets:
- SPL:
- - Fixed bug (SplFileObject - seek and key with csv file inconsistent).
+ - Fixed bug (SplFileObject - seek and key with csv file inconsistent).
- Standard:
- - Fixed bug (Force macOS to use statfs).
+ - Fixed bug (Force macOS to use statfs).
@@ -3962,24 +3962,24 @@
- Iconv:
- - Fixed bug (ob_clean() only does not set Content-Encoding).
- - Fixed bug (Unexpected result for iconv_mime_decode).
+ - Fixed bug (ob_clean() only does not set Content-Encoding).
+ - Fixed bug (Unexpected result for iconv_mime_decode).
- MySQLnd:
- - Fixed bug (NULL pointer dereference in mysqlnd package).
+ - Fixed bug (NULL pointer dereference in mysqlnd package).
- OPcache:
- - Fixed bug (Wrong type inference of range() result).
+ - Fixed bug (Wrong type inference of range() result).
- Reflection:
- - Fixed bug (ReflectionClass::getConstants() depends on def. order).
+ - Fixed bug (ReflectionClass::getConstants() depends on def. order).
- Zlib:
- - Fixed bug (ob_clean() only does not set Content-Encoding).
+ - Fixed bug (ob_clean() only does not set Content-Encoding).
@@ -3992,11 +3992,11 @@
- Core:
- (Attribute instantiation leaves dangling pointer).
- - Fixed bug (Environment vars may be mangled on Windows).
+ - Fixed bug (Environment vars may be mangled on Windows).
- FFI:
- - Fixed bug (FFI::cast() from pointer to array is broken).
+ - Fixed bug (FFI::cast() from pointer to array is broken).
- Filter:
- MBString:
- - Fixed bug (mb_send_mail may delimit headers with LF only).
+ - Fixed bug (mb_send_mail may delimit headers with LF only).
- MySQLnd:
- - Fixed bug (MariaDB version prefix 5.5.5- is not stripped).
+ - Fixed bug (MariaDB version prefix 5.5.5- is not stripped).
- Sockets:
- Fixed ext/sockets build on Haiku.
- - Fixed bug (sockets extension compilation errors).
+ - Fixed bug (sockets extension compilation errors).
- Standard:
- - Fixed bug (mails are sent even if failure to log throws exception).
+ - Fixed bug (mails are sent even if failure to log throws exception).
@@ -4042,8 +4042,8 @@
Hash:
- - Fixed bug (Incorrect return types for hash() and hash_hmac()).
- - Fixed bug (Inconsistent argument name in hash_hmac_file and hash_file).
+ - Fixed bug (Incorrect return types for hash() and hash_hmac()).
+ - Fixed bug (Inconsistent argument name in hash_hmac_file and hash_file).
MySQLnd:
OCI8:
- - Fixed bug (php_oci_cleanup_global_handles segfaults at second call).
+ - Fixed bug (php_oci_cleanup_global_handles segfaults at second call).
OPcache:
diff --git a/cached.php b/cached.php
index 766afb2e65..4a8dbd112f 100644
--- a/cached.php
+++ b/cached.php
@@ -22,7 +22,7 @@
$abs = realpath($abs);
if (strncmp($abs, $pwd, strlen($pwd)) != 0) {
- header("Location: https://www.php.net/" . strtr($_GET["f"],["\r" => "", "\n" => ""]));
+ header("Location: https://www.php.net/" . strtr($_GET["f"], ["\r" => "", "\n" => ""]));
exit;
}
diff --git a/cal.php b/cal.php
index 68b5ca1331..5f387f9eff 100644
--- a/cal.php
+++ b/cal.php
@@ -49,7 +49,7 @@
elseif ($cy && $cm && $cd) {
// Check if date is valid
- if (checkdate($cm,$cd,$cy)) {
+ if (checkdate($cm, $cd, $cy)) {
// Date integer for that day
$date = mktime(0, 0, 1, $cm, $cd, $cy);
@@ -68,7 +68,7 @@
// Unable to load events for that day
else {
- $errors[] = "There are no events for the specified date (" . date("F j, Y",$date) . ").";
+ $errors[] = "There are no events for the specified date (" . date("F j, Y", $date) . ").";
}
}
@@ -80,7 +80,7 @@
}
// Check if month and year is valid
-if ($cm && $cy && !checkdate($cm,1,$cy)) {
+if ($cm && $cy && !checkdate($cm, 1, $cy)) {
$errors[] = "The specified year and month (" . htmlentities("$cy, $cm", ENT_QUOTES | ENT_IGNORE, 'UTF-8') . ") are not valid.";
unset($cm, $cy);
}
@@ -125,7 +125,7 @@
}
// Beginning and end of this month
-$bom = mktime(0, 0, 1, $cm, 1, $cy);
+$bom = mktime(0, 0, 1, $cm, 1, $cy);
$eom = mktime(0, 0, 1, $cm + 1, 0, $cy);
// Link to previous month (but do not link to too early dates)
@@ -138,11 +138,13 @@
$month = date('m', $lm);
$monthName = date('F', $lm);
- return sprintf('%s, %s',
- urlencode($month),
- urlencode($year),
- htmlentities($monthName),
- htmlentities($year));
+ return sprintf(
+ '%s, %s',
+ urlencode($month),
+ urlencode($year),
+ htmlentities($monthName),
+ htmlentities($year)
+ );
})();
// Link to next month (but do not link to too early dates)
@@ -155,11 +157,13 @@
$month = date('m', $nm);
$monthName = date('F', $nm);
- return sprintf('%s, %s',
- urlencode($month),
- urlencode($year),
- htmlentities($monthName),
- htmlentities($year));
+ return sprintf(
+ '%s, %s',
+ urlencode($month),
+ urlencode($year),
+ htmlentities($monthName),
+ htmlentities($year)
+ );
})();
// Print out navigation links for previous and next month
@@ -174,22 +178,22 @@
// Print out headers for weekdays
for ($i = 0; $i < 7; $i++) {
- echo '', date("l",mktime(0,0,1,4,$i + 1,2001)), " | \n";
+ echo '', date("l", mktime(0, 0, 1, 4, $i + 1, 2001)), " | \n";
}
echo "\n";
// Generate the requisite number of blank days to get things started
-for ($days = $i = date("w",$bom); $i > 0; $i--) {
+for ($days = $i = date("w", $bom); $i > 0; $i--) {
echo ' | ';
}
// Print out all the days in this month
-for ($i = 1; $i <= date("t",$bom); $i++) {
+for ($i = 1; $i <= date("t", $bom); $i++) {
// Print out day number and all events for the day
echo '',$i,'';
- display_events_for_day(date("Y-m-",$bom) . sprintf("%02d",$i), $events);
+ display_events_for_day(date("Y-m-", $bom) . sprintf("%02d", $i), $events);
echo ' | ';
// Break HTML table row if at end of week
@@ -218,11 +222,11 @@ function date_for_recur($recur, $day, $bom, $eom)
if ($recur > 0) {
$bomd = date("w", $bom) + 1;
$days = (($day - $bomd + 7) % 7) + (($recur - 1) * 7);
- return mktime(0,0,1, date("m",$bom), $days + 1, date("Y",$bom));
+ return mktime(0, 0, 1, date("m", $bom), $days + 1, date("Y", $bom));
}
// ${recur}th to last $day of the month
- $eomd = date("w",$eom) + 1;
+ $eomd = date("w", $eom) + 1;
$days = (($eomd - $day + 7) % 7) + ((abs($recur) - 1) * 7);
return mktime(0, 0, 1, date("m", $bom) + 1, -$days, date("Y", $bom));
@@ -256,7 +260,7 @@ function display_events_for_day($day, $events): void
function load_event($id)
{
// Open events CSV file, return on error
- $fp = @fopen("backend/events.csv",'r');
+ $fp = @fopen("backend/events.csv", 'r');
if (!$fp) { return false; }
// Read as we can, event by event
@@ -283,15 +287,15 @@ function load_events($from, $whole_month = false)
{
// Take advantage of the equality behavior of this date format
$from_date = date("Y-m-d", $from);
- $bom = mktime(0, 0, 1, date("m",$from), 1, date("Y",$from));
- $eom = mktime(0, 0, 1, date("m",$from) + 1, 0, date("Y",$from));
+ $bom = mktime(0, 0, 1, date("m", $from), 1, date("Y", $from));
+ $eom = mktime(0, 0, 1, date("m", $from) + 1, 0, date("Y", $from));
$to_date = date("Y-m-d", $whole_month ? $eom : $from);
// Set arrays to their default
$events = $seen = [];
// Try to open the events file for reading, return if unable to
- $fp = @fopen("backend/events.csv",'r');
+ $fp = @fopen("backend/events.csv", 'r');
if (!$fp) { return false; }
// For all events, read in the event and check it if fits our scope
diff --git a/downloads.php b/downloads.php
index b82abe3513..4ba94b8aa2 100644
--- a/downloads.php
+++ b/downloads.php
@@ -25,7 +25,8 @@
Old archives
';
-site_header("Downloads",
+site_header(
+ "Downloads",
[
'link' => [
[
diff --git a/include/branches.inc b/include/branches.inc
index 5a2ac26d24..8514f86e04 100644
--- a/include/branches.inc
+++ b/include/branches.inc
@@ -63,15 +63,16 @@ function format_interval($from, $to) {
$eolPeriod = 'midnight';
}
if ($times) {
- $eolPeriod = implode(', ',
- array_map(
- function ($t) {
+ $eolPeriod = implode(
+ ', ',
+ array_map(
+ function ($t) {
return "$t[0] $t[1]" .
($t[0] != 1 ? 's' : '');
},
- $times
- )
- );
+ $times
+ )
+ );
if ($diff->invert) {
$eolPeriod = "$eolPeriod ago";
diff --git a/include/email-validation.inc b/include/email-validation.inc
index 4a8b6b98d4..67e7a85010 100644
--- a/include/email-validation.inc
+++ b/include/email-validation.inc
@@ -103,6 +103,6 @@ function blacklisted($email) {
'@conferenceseries.com',
];
foreach ($mosquitoes as $m) {
- if (preg_match('/' . preg_quote($m, '/') . '/i',$email)) return true;
+ if (preg_match('/' . preg_quote($m, '/') . '/i', $email)) return true;
}
}
diff --git a/include/gpg-keys.inc b/include/gpg-keys.inc
index df5bc8c61c..adf68dcb48 100644
--- a/include/gpg-keys.inc
+++ b/include/gpg-keys.inc
@@ -191,7 +191,8 @@ function gpg_key_show_keys(bool $activeOnly): void {
foreach (gpg_key_get_branches($activeOnly) as $branch => $rms) {
$keys = array_filter(
array_map(function ($rm) { return gpg_key_get($rm); }, $rms),
- function ($key) { return $key !== null; });
+ function ($key) { return $key !== null; }
+ );
if (empty($keys)) { continue; }
$branch = htmlentities($branch, ENT_QUOTES, 'UTF-8');
diff --git a/include/langchooser.inc b/include/langchooser.inc
index a1897fe725..1b66427176 100644
--- a/include/langchooser.inc
+++ b/include/langchooser.inc
@@ -56,7 +56,7 @@ function language_choose_code()
}
// Specified in a shortcut URL (eg. /en/echo or /pt_br/echo)
- if (preg_match("!^/(\\w{2}(_\\w{2})?)/!", htmlspecialchars($_SERVER['REQUEST_URI'],ENT_QUOTES, 'UTF-8'), $flang)) {
+ if (preg_match("!^/(\\w{2}(_\\w{2})?)/!", htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8'), $flang)) {
// Put language into preference list
$rlang = language_add($flang[1], $languages);
@@ -68,7 +68,9 @@ function language_choose_code()
// Drop out langauge specification from URL, as this is already handled
$_SERVER['STRIPPED_URI'] = preg_replace(
- "!^/$flang[1]/!", "/", htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8')
+ "!^/$flang[1]/!",
+ "/",
+ htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8')
);
}
diff --git a/include/layout.inc b/include/layout.inc
index 563ed8bade..84b19075d6 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -6,8 +6,8 @@ $_SERVER['MYSITE'] = $MYSITE;
ini_set('highlight.comment', 'comment');
ini_set('highlight.default', 'default');
ini_set('highlight.keyword', 'keyword');
-ini_set('highlight.string', 'string');
-ini_set('highlight.html', 'html');
+ini_set('highlight.string', 'string');
+ini_set('highlight.html', 'html');
// Highlight PHP code
function highlight_php($code, $return = false)
@@ -57,7 +57,7 @@ function commonFooter(): void { site_footer(); }
function resize_image($img, $width = 1, $height = 1)
{
// Drop width and height values from image if available
- $str = preg_replace('!width=\"([0-9]+?)\"!i', '', $img);
+ $str = preg_replace('!width=\"([0-9]+?)\"!i', '', $img);
$str = preg_replace('!height=\"([0-9]+?)\"!i', '', $str);
// Return image with new width and height added
@@ -69,8 +69,14 @@ function resize_image($img, $width = 1, $height = 1)
}
// Return an
tag for a given image file available on the server
-function make_image($file, $alt = false, $align = false, $extras = false,
- $dir = '/images', $addsize = true)
+function make_image(
+ $file,
+ $alt = false,
+ $align = false,
+ $extras = false,
+ $dir = '/images',
+ $addsize = true
+)
{
// If no / was provided at the start of $dir, add it
$webdir = $_SERVER['MYSITE'] . ($dir[0] == '/' ? '' : '/') . $dir;
@@ -93,7 +99,8 @@ function make_image($file, $alt = false, $align = false, $extras = false,
}
// Return with image built up
- return sprintf('
',
+ return sprintf(
+ '
',
$webdir,
$file,
($alt ?: ''),
@@ -104,8 +111,13 @@ function make_image($file, $alt = false, $align = false, $extras = false,
}
// Print an
tag out for a given file
-function print_image($file, $alt = false, $align = false, $extras = false,
- $dir = '/images'): void
+function print_image(
+ $file,
+ $alt = false,
+ $align = false,
+ $extras = false,
+ $dir = '/images'
+): void
{
echo make_image($file, $alt, $align, $extras, $dir);
}
@@ -122,8 +134,14 @@ function news_image($URL, $image, $alt, $print = true)
}
// Return HTML code for a submit button image
-function make_submit($file, $alt = false, $align = false, $extras = false,
- $dir = '/images', $border = 0)
+function make_submit(
+ $file,
+ $alt = false,
+ $align = false,
+ $extras = false,
+ $dir = '/images',
+ $border = 0
+)
{
// Get an image without size info and convert the
// border attribute to use CSS, as border="" is not
@@ -149,12 +167,13 @@ function make_link (string $url, string $linktext = ''): string
// return a hyperlink to something, within the site, that pops up a new window
//
function make_popup_link ($url, $linktext = false, $target = false, $windowprops = "", $extras = false) {
- return sprintf("%s",
+ return sprintf(
+ "%s",
htmlspecialchars($url, ENT_QUOTES | ENT_IGNORE),
($target ?: "_new"),
htmlspecialchars($url, ENT_QUOTES | ENT_IGNORE),
($target ?: "_new"),
- $windowprops,
+ $windowprops,
($extras ? ' ' . $extras : ''),
($linktext ?: $url)
);
@@ -279,13 +298,13 @@ function display_event($event, $include_date = 1): void
];
if (!isset($event['start']) && isset($event['sday'])) {
- $sday = mktime(12,0,0,$event['smonth'],$event['sday'],$event['syear']);
+ $sday = mktime(12, 0, 0, $event['smonth'], $event['sday'], $event['syear']);
} else {
$sday = (isset($event['start']) && !empty($event['start'])) ? strtotime($event['start']) : 0;
}
if (!isset($event['end']) && isset($event['eday'])) {
- $eday = mktime(12,0,0,$event['emonth'],$event['eday'],$event['eyear']);
+ $eday = mktime(12, 0, 0, $event['emonth'], $event['eday'], $event['eyear']);
} else {
$eday = (isset($event['end']) && !empty($event['end'])) ? strtotime($event['end']) : 0;
}
@@ -311,7 +330,7 @@ function display_event($event, $include_date = 1): void
case 2:
case 'multi':
$dtend = date("Y-m-d", strtotime("+1 day", $eday));
- echo " (", date("Y-m-d",$sday), " to ", date("Y-m-d",$eday), ")";
+ echo " (", date("Y-m-d", $sday), " to ", date("Y-m-d", $eday), ")";
break;
case 3:
case 'recur':
@@ -340,7 +359,7 @@ function display_event($event, $include_date = 1): void
", trim(htmlentities($event['ldesc'],ENT_QUOTES | ENT_IGNORE, 'UTF-8')));
+ echo preg_replace("/\r?\n\r?\n/", "
", trim(htmlentities($event['ldesc'], ENT_QUOTES | ENT_IGNORE, 'UTF-8')));
// If we have an URL, print it out
if ($event['url']) {
echo '
URL: ',
diff --git a/include/results.inc b/include/results.inc
index 25f93bf64b..da95f51934 100644
--- a/include/results.inc
+++ b/include/results.inc
@@ -41,9 +41,9 @@ function search_results($res, $q, $profile = 'all', $per_page = 10, $s = 0, $l =
// rewrite mirrors urls (\w\w\d? or www, but not qa, doc, gtk and ~/user)
$real_url = preg_replace('@^http://(?!doc|qa|gtk)\w{2,3}\.php\.net(?!/~)(.*)$@', '$1', $hit['Url']);
$displayurl = preg_replace('@^http://(?:(?!doc|qa|php|gtk)\w{2,3}\.)?(.+[^/])/?$@', '$1', $hit['Url']);
- $type = substr($displayurl,0,strpos($displayurl,'.'));
- if($type == 'pecl' && strstr($displayurl,"/bugs/")) $type = "peclbugs";
- if($type == 'pear' && strstr($displayurl,"/bugs/")) $type = "pearbugs";
+ $type = substr($displayurl, 0, strpos($displayurl, '.'));
+ if($type == 'pecl' && strstr($displayurl, "/bugs/")) $type = "peclbugs";
+ if($type == 'pear' && strstr($displayurl, "/bugs/")) $type = "pearbugs";
if($type == 'smarty') continue;
$display_title = str_replace(['PHP:', '&'], ['', '&'], $hit['Title']);
diff --git a/index.php b/index.php
index 820b9e1b78..b5ff67f724 100644
--- a/index.php
+++ b/index.php
@@ -121,7 +121,8 @@
$meta_image_path = $MYSITE . 'images/meta-image.png';
$meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.";
-site_header("Hypertext Preprocessor",
+site_header(
+ "Hypertext Preprocessor",
[
'current' => 'home',
'headtags' => [
diff --git a/manual/vote-note.php b/manual/vote-note.php
index dae5b8b559..7d0f0ea269 100644
--- a/manual/vote-note.php
+++ b/manual/vote-note.php
@@ -30,7 +30,7 @@
"vote" => $_REQUEST['vote'],
"ip" => $_SERVER['REMOTE_ADDR']
];
- if (($r = posttohost($master_url, $data)) === null || strpos($r,"failed to open socket to") !== false) {
+ if (($r = posttohost($master_url, $data)) === null || strpos($r, "failed to open socket to") !== false) {
$response["success"] = false;
$response["msg"] = "Could not process your request at this time. Please try again later...";
}
@@ -72,7 +72,7 @@
"vote" => $_REQUEST['vote'],
"ip" => $_SERVER['REMOTE_ADDR'],
];
- if (($r = posttohost($master_url, $data)) !== null && strpos($r,"failed to open socket to") === false) {
+ if (($r = posttohost($master_url, $data)) !== null && strpos($r, "failed to open socket to") === false) {
$r = json_decode($r);
if (isset($r->status, $r->votes) && $r->status) {
$thankyou = true;
diff --git a/releases/8.0/common.php b/releases/8.0/common.php
index f25c034cf4..9f02b4934b 100644
--- a/releases/8.0/common.php
+++ b/releases/8.0/common.php
@@ -7,7 +7,8 @@ function common_header(string $description): void {
global $MYSITE;
$meta_image_path = \htmlspecialchars(
- \filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL));
+ \filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL)
+ );
$meta_description = \htmlspecialchars($description);
\site_header("PHP 8.0.0 Release Announcement", [
diff --git a/releases/8.0/de.php b/releases/8.0/de.php
index 939ec822ab..b80bd54357 100644
--- a/releases/8.0/de.php
+++ b/releases/8.0/de.php
@@ -7,7 +7,8 @@
'Es beinhaltet viele neue Funktionen und Optimierungen wie beispielsweise ' .
'Named Arguments, Union Types, Attribute, Constructor Property Promotion, ' .
'Match Ausdrücke, Nullsafe Operator, JIT und Verbesserungen des Typen-Systems, ' .
- 'der Fehlerbehandlung und der Konsistenz.');
+ 'der Fehlerbehandlung und der Konsistenz.'
+);
?>