Skip to content

Commit

Permalink
Fixes for 5.3.1 (#3370)
Browse files Browse the repository at this point in the history
* Fix import locale

* Bump packages

* Use new redux tools

* Fix unit tests

fix

* Fix locale files with incorrect interpolation

* Add NE flag to Apache when URL is encoded

* Apply case transform to URL path

This fixes URLs with mixed case not being detected as a match

* Bundle 5.3.1
  • Loading branch information
johngodley authored Jul 29, 2022
1 parent 2757577 commit 4d8f832
Show file tree
Hide file tree
Showing 55 changed files with 2,721 additions and 2,590 deletions.
9 changes: 4 additions & 5 deletions client/page/io/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* External dependencies
*/

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

const Importer = props => {
function Importer( props ) {
const { plugin, doImport } = props;
const { name, total } = plugin;
const clicker = () => {
Expand All @@ -14,10 +13,10 @@ const Importer = props => {

return (
<div className="plugin-importer">
<p><strong>{ name }</strong> ({ __( 'total = ', 'redirection' ) + total } )</p>
<p><strong>{ name }</strong> ({ sprintf( __( 'total = %d', 'redirection' ), total ) })</p>

<button onClick={ clicker } className="button-secondary">
{ __( 'Import from %s', { args: name } ) }
{ sprintf( __( 'Import from %s', 'redirection' ), name ) }
</button>
</div>
);
Expand Down
8 changes: 2 additions & 6 deletions client/state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
applyMiddleware,
createStore,
} from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';
import { composeWithDevTools } from '@redux-devtools/extension';
import thunk from 'redux-thunk';
import reducers from './reducers';
import { urlMiddleware } from 'state/middleware';
Expand All @@ -15,10 +15,6 @@ import { urlMiddleware } from 'state/middleware';
* Internal dependencies
*/

const composeEnhancers = composeWithDevTools( {
name: 'Redirection',
} );

const middlewares = [
thunk,
urlMiddleware,
Expand All @@ -28,7 +24,7 @@ export default function createReduxStore( initialState = {} ) {
const store = createStore(
reducers,
initialState,
composeEnhancers( applyMiddleware( ...middlewares ) )
composeWithDevTools( applyMiddleware( ...middlewares ) )
);

return store;
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
},
"scripts": {
"pot": "wp i18n make-pot . locale/redirection.pot --ignore-domain --exclude=redirection-strings.php",
"json": "wp i18n make-json locale --purge"
"json": "wp i18n make-json locale --purge",
"test": "./vendor/bin/phpunit"
},
"config": {
"allow-plugins": {
Expand Down
26 changes: 26 additions & 0 deletions e2e/__tests__/url.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,31 @@
"status": 200
}
}
],
[
"Test array query parameter with case",
{
"source": {
"url": "/array?queryParam[thing]=1"
},
"target": {
"location": "/plain-redirect/",
"status": 301,
"agent": true
}
}
],
[
"Test array query parameter without case",
{
"source": {
"url": "/array?queryparam[thing]=1"
},
"target": {
"location": "/plain-redirect/",
"status": 301,
"agent": true
}
}
]
]
6 changes: 5 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ function potJson( done ) {
return src( [ 'locale/*.po' ] )
.pipe( po2json() )
.pipe( through.obj( ( file, enc, cb ) => {
const json = JSON.parse( String( file.contents ) );
const json = JSON
.parse( String( file.contents )
.replace( ' {code', ' {{code' )
.replace( '{{{', '{{' )
.replace( '}}}', '}}' ) );

json[ '' ] = {
'plural-forms': json[ '' ][ 'plural-forms' ]
Expand Down
2 changes: 1 addition & 1 deletion locale/json/redirection-de_DE.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-el.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-en_AU.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-en_CA.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-en_GB.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-en_NZ.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-en_ZA.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-es_CO.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-es_EC.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-es_ES.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-es_MX.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-es_VE.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-fa_IR.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-fr_CA.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-fr_FR.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-gl_ES.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-hr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-it_IT.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-ja.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-nl_NL.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-pt_BR.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-ru_RU.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locale/json/redirection-sv_SE.json

Large diffs are not rendered by default.

Loading

0 comments on commit 4d8f832

Please sign in to comment.