Skip to content

Commit 4c60b9c

Browse files
author
Kaspars Dambis
authored
Specify version of Node and disable Renovate for Composer because of old PHP versions (xwp#1072)
1 parent 598c590 commit 4c60b9c

21 files changed

+410
-161
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
services:
2929
- mysql
3030

31+
before_install:
32+
- nvm install
33+
- nvm use
34+
3135
install:
3236
- npm install
3337
- export DEV_LIB_PATH="vendor/xwp/wp-dev-lib/scripts"

alerts/class-alert-type-ifttt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function notify_ifttt( $alert, $recordarr ) {
242242
* @return string
243243
*/
244244
$date_format = apply_filters( 'wp_stream_alert_ifttt_date_format', 'Y-m-d H:i:s', $alert, $recordarr );
245-
$date = date( $date_format, strtotime( $created ) );
245+
$date = gmdate( $date_format, strtotime( $created ) );
246246

247247
$url = 'https://maker.ifttt.com/trigger/' . $alert->alert_meta['event_name'] . '/with/key/' . $alert->alert_meta['maker_key'];
248248

classes/class-alerts-list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function enqueue_scripts( $page ) {
356356
wp_register_style(
357357
'wp-stream-alerts-list-css',
358358
$this->plugin->locations['url'] . 'ui/css/alerts-list.' . $min . 'css',
359-
[],
359+
array(),
360360
$this->plugin->get_version()
361361
);
362362

classes/class-export.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function build_record( $item, $columns ) {
9999
foreach ( array_keys( $columns ) as $column_name ) {
100100
switch ( $column_name ) {
101101
case 'date':
102-
$created = date( 'Y-m-d H:i:s', strtotime( $record->created ) );
102+
$created = gmdate( 'Y-m-d H:i:s', strtotime( $record->created ) );
103103
$row_out[ $column_name ] = get_date_from_gmt( $created, 'Y/m/d h:i:s A' );
104104
break;
105105

classes/class-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function column_default( $item, $column_name ) {
252252

253253
switch ( $column_name ) {
254254
case 'date':
255-
$created = date( 'Y-m-d H:i:s', strtotime( $record->created ) );
255+
$created = gmdate( 'Y-m-d H:i:s', strtotime( $record->created ) );
256256
$date_string = sprintf(
257257
'<time datetime="%s" class="relative-time record-created">%s</time>',
258258
wp_stream_get_iso_8601_extended_date( strtotime( $record->created ) ),

classes/class-query.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,22 @@ public function query( $args ) {
8080
}
8181

8282
if ( ! empty( $args['date_from'] ) ) {
83-
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_from'] . ' 00:00:00' ) ) );
83+
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_from'] . ' 00:00:00' ) ) );
8484
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) >= %s", $date );
8585
}
8686

8787
if ( ! empty( $args['date_to'] ) ) {
88-
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_to'] . ' 23:59:59' ) ) );
88+
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_to'] . ' 23:59:59' ) ) );
8989
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) <= %s", $date );
9090
}
9191

9292
if ( ! empty( $args['date_after'] ) ) {
93-
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_after'] ) ) );
93+
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_after'] ) ) );
9494
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) > %s", $date );
9595
}
9696

9797
if ( ! empty( $args['date_before'] ) ) {
98-
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_before'] ) ) );
98+
$date = get_gmt_from_date( gmdate( 'Y-m-d H:i:s', strtotime( $args['date_before'] ) ) );
9999
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) < %s", $date );
100100
}
101101

connectors/class-connector-mercator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function get_context_labels() {
7878
*
7979
* @filter wp_stream_action_links_{connector}
8080
*
81-
* @param array $links
81+
* @param array $links
8282
* @param Record $record
8383
*
8484
* @return array

connectors/class-connector-user-switching.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ public function log_override( $data ) {
104104
* @param Connectors $connectors The Connectors object instance
105105
*/
106106
public function callback_wp_stream_after_connectors_registration( array $labels, Connectors $connectors ) {
107-
$action = wp_stream_filter_input( INPUT_GET, 'action' ) ?: wp_stream_filter_input( INPUT_POST, 'action' );
107+
$action = wp_stream_filter_input( INPUT_GET, 'action' );
108+
109+
if ( ! $action ) {
110+
$action = wp_stream_filter_input( INPUT_POST, 'action' );
111+
}
108112

109113
if ( ! $action ) {
110114
return;

includes/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function wp_stream_get_iso_8601_extended_date( $time = false, $offset = 0 ) {
5151
$offset_string = sprintf( 'Etc/GMT%s%s', $offset < 0 ? '+' : '-', abs( $offset ) );
5252

5353
$timezone = new DateTimeZone( $offset_string );
54-
$date = new DateTime( date( 'Y-m-d H:i:s.' . $micro_seconds, $microtime ), $timezone );
54+
$date = new DateTime( gmdate( 'Y-m-d H:i:s.' . $micro_seconds, $microtime ), $timezone );
5555

5656
return sprintf(
5757
'%s%03d%s',
@@ -131,7 +131,7 @@ function wp_stream_is_cron_enabled() {
131131
* @return string
132132
*/
133133
function wp_stream_min_suffix() {
134-
$min = '';
134+
$min = '';
135135
$is_script_debugging = ! defined( 'SCRIPT_DEBUG' ) || false === SCRIPT_DEBUG;
136136

137137
if ( apply_filters( 'wp_stream_load_min_assets', $is_script_debugging ) ) {

includes/lib/Carbon.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,14 @@ public static function minValue()
312312
*/
313313
public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
314314
{
315-
$year = ($year === null) ? date('Y') : $year;
316-
$month = ($month === null) ? date('n') : $month;
317-
$day = ($day === null) ? date('j') : $day;
315+
$year = ($year === null) ? gmdate('Y') : $year;
316+
$month = ($month === null) ? gmdate('n') : $month;
317+
$day = ($day === null) ? gmdate('j') : $day;
318318

319319
if ($hour === null) {
320-
$hour = date('G');
321-
$minute = ($minute === null) ? date('i') : $minute;
322-
$second = ($second === null) ? date('s') : $second;
320+
$hour = gmdate('G');
321+
$minute = ($minute === null) ? gmdate('i') : $minute;
322+
$second = ($second === null) ? gmdate('s') : $second;
323323
} else {
324324
$minute = ($minute === null) ? 0 : $minute;
325325
$second = ($second === null) ? 0 : $second;
@@ -2211,4 +2211,4 @@ public function isBirthday(Carbon $dt)
22112211
{
22122212
return $this->month === $dt->month && $this->day === $dt->day;
22132213
}
2214-
}
2214+
}

0 commit comments

Comments
 (0)