Skip to content

Commit

Permalink
Update 5.4.2 (#3788)
Browse files Browse the repository at this point in the history
* Fix crash in agent info if no URL

* Disable IP info

* Add new option for max-age header

* Rename the PHPCS file

* Remove deprecated ini_set

* Don’t double encode URLs when checking them

Although it worked, it looked like it didn’t

* Improve linting

* Update locale

* Update version

* Update PHP version info

* Bundle

* Set version
  • Loading branch information
johngodley authored Jan 27, 2024
1 parent a0780ec commit a7c8dcd
Show file tree
Hide file tree
Showing 98 changed files with 5,878 additions and 2,354 deletions.
4 changes: 4 additions & 0 deletions client/component/useragent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class Useragent extends React.Component {
}

getType( type, url ) {
if ( ! type ) {
return null;
}

const name = type.slice( 0, 1 ).toUpperCase() + type.slice( 1 );

if ( url ) {
Expand Down
8 changes: 3 additions & 5 deletions client/page/logs/row-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
* External dependencies
*/

import React from 'react';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/

import { RowActions, RowAction } from 'component/table/row-action';
import GeoMapAction from 'component/log-page/log-actions/geo-map';
import UseragentAction from 'component/log-page/log-actions/user-agent';
import ExtraDataAction from 'component/log-page/log-actions/extra-data';

Expand All @@ -31,9 +29,9 @@ function LogRowActions( props ) {
</RowAction>
);

if ( ip ) {
menu.unshift( <GeoMapAction key="2" ip={ ip } /> );
}
// if ( ip ) {
// menu.unshift( <GeoMapAction key="2" ip={ ip } /> );
// }

if ( agent ) {
menu.unshift( <UseragentAction key="3" agent={ agent } /> );
Expand Down
8 changes: 3 additions & 5 deletions client/page/logs404/row-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/

import React from 'react';
import { connect } from 'react-redux';
import { __ } from '@wordpress/i18n';

Expand All @@ -13,7 +12,6 @@ import { __ } from '@wordpress/i18n';
import { RowActions, RowAction } from 'component/table/row-action';
import { setFilter } from 'state/error/action';
import { CAP_REDIRECT_MANAGE, CAP_404_DELETE, CAP_REDIRECT_ADD } from 'lib/capabilities';
import GeoMapAction from 'component/log-page/log-actions/geo-map';
import UseragentAction from 'component/log-page/log-actions/user-agent';
import getCreateAction from './create-action';

Expand Down Expand Up @@ -53,9 +51,9 @@ function ErrorRowActions( props ) {
</RowAction>
);

if ( ip ) {
menu.unshift( <GeoMapAction key="2" ip={ ip } /> );
}
// if ( ip ) {
// menu.unshift( <GeoMapAction key="2" ip={ ip } /> );
// }

if ( agent ) {
menu.unshift( <UseragentAction key="3" agent={ agent } /> );
Expand Down
7 changes: 6 additions & 1 deletion client/page/redirects/columns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ function getServer( item ) {
}

function escapeUrl( url ) {
return encodeURIComponent( url ).replace( /%2F/gi, '/' );
let newUrl = encodeURIComponent( url ).replace( /%2F/gi, '/' );

newUrl = newUrl.replace( /%3F/gi, '?' );
newUrl = newUrl.replace( /%3D/gi, '=' );
newUrl = newUrl.replace( /%26/gi, '&' );
return newUrl;
}

export default function getColumns( row, rowParams, disabled, defaultFlags, group ) {
Expand Down
1 change: 1 addition & 0 deletions client/page/site/headers/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const knownHeaders = {
'max-age=<expire-time>',
'max-age=<expire-time>; includeSubDomains',
'max-age=<expire-time>; preload',
'max-age=<expire-time>; includeSubDomains; preload',
] ),
replace: 'expire-time',
replaceType: 'integer',
Expand Down
49 changes: 27 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
{
"require-dev": {
"vimeo/psalm": "^3.14.2",
"yoast/phpunit-polyfills": "^1.0",
"wp-cli/wp-cli-bundle": "*",
"humanmade/psalm-plugin-wordpress": "^1.0",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.10",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpstan/extension-installer": "^1.3"
},
"scripts": {
"pot": "wp i18n make-pot . locale/redirection.pot --ignore-domain --exclude=redirection-strings.php",
"json": "wp i18n make-json locale --purge",
"test": "./vendor/bin/phpunit",
"phpstan": "./vendor/bin/phpstan analyse --configuration=phpstan.neon"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
}
"require-dev": {
"vimeo/psalm": "^5.18",
"yoast/phpunit-polyfills": "^2.0",
"wp-cli/wp-cli-bundle": "^2.9",
"phpunit/phpunit": "^10.5",
"phpstan/phpstan": "^1.10",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpstan/extension-installer": "^1.3",
"squizlabs/php_codesniffer": "^3.8",
"wp-coding-standards/wpcs": "^3.0",
"sirbrillig/phpcs-variable-analysis": "^2.11",
"sirbrillig/phpcs-no-get-current-user": "^1.1",
"phpcompatibility/php-compatibility": "^9.3"
},
"scripts": {
"pot": "wp i18n make-pot . locale/redirection.pot --ignore-domain --exclude=redirection-strings.php",
"json": "wp i18n make-json locale --purge",
"test": "./vendor/bin/phpunit",
"phpstan": "./vendor/bin/phpstan analyse --configuration=phpstan.neon",
"lint": "./vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=vendor ./models ./api ./actions ./modules ./matches ./fileio ./database ./*.php"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
}
}
Loading

0 comments on commit a7c8dcd

Please sign in to comment.