PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
6.2.3 6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 All 156 releases
← All changes | modules/logs/includes/functions.php +16 -11 5.0.3.1 → 6.2.1 View file →
@@ -4,8 +4,13 @@
4 4 *
5 5 * @package MainWP\Dashboard
6 6 */
7 7
8 +// Exit.
9 +if ( ! defined( 'ABSPATH' ) ) {
10 + exit;
11 +}
12 +
8 13 /**
9 14 * Filters a variable with a specified filter.
10 15 *
11 16 * This is a polyfill function intended to be used in place of PHP's
@@ -17,9 +22,9 @@
17 22 *
18 23 * @return Returns the filtered data, or FALSE if the filter fails.
19 24 */
20 25 function mainwp_module_log_filter_var( $var_value, $filter = null, $options = array() ) { //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
21 - return call_user_func_array( array( '\MainWP\Dashboard\Module\Log\Log_Filter_Input', 'filter' ), func_get_args() );
26 + return call_user_func_array( array( '\MainWP\Dashboard\Module\Log\Log_Filter_Input', 'filter' ), func_get_args() );
22 27 }
23 28
24 29
25 30 /**
@@ -30,18 +35,18 @@
30 35 *
31 36 * @return string an ISO 8601 extended formatted time
32 37 */
33 38 function mainwp_module_log_get_iso_8601_extended_date( $time = false, $offset = 0 ) {
34 - if ( $time ) {
35 - $microtime = (float) $time . '.0000';
36 - } else {
37 - $microtime = microtime( true );
38 - }
39 + if ( $time ) {
40 + $microtime = (float) ( $time . '.0000' );
41 + } else {
42 + $microtime = microtime( true );
43 + }
39 44
40 - $micro_seconds = sprintf( '%06d', ( $microtime - floor( $microtime ) ) * 1000000 );
41 - $offset_string = sprintf( 'Etc/GMT%s%d', $offset < 0 ? '+' : '-', abs( $offset ) );
45 + $micro_seconds = sprintf( '%06d', ( $microtime - floor( $microtime ) ) * 1000000 );
46 + $offset_string = sprintf( 'Etc/GMT%s%d', $offset < 0 ? '+' : '-', abs( $offset ) );
42 47
43 - $timezone = new DateTimeZone( $offset_string );
44 - $date = new DateTime( gmdate( 'Y-m-d H:i:s.' . $micro_seconds, $microtime ), $timezone );
48 + $timezone = new DateTimeZone( $offset_string );
49 + $date = new DateTime( gmdate( 'Y-m-d H:i:s.' . $micro_seconds, (int) $microtime ), $timezone );
45 50
46 - return $date->format( 'Y-m-d\TH:i:sO' );
51 + return $date->format( 'Y-m-d\TH:i:sO' );
47 52 }