Skip to content

Commit

Permalink
Merge pull request #2722 from johngodley/fix/5.0.1
Browse files Browse the repository at this point in the history
5.0.1 fixes
  • Loading branch information
johngodley authored Jan 25, 2021
2 parents b0942f1 + 0537c06 commit a2af44b
Show file tree
Hide file tree
Showing 19 changed files with 2,026 additions and 1,581 deletions.
2 changes: 0 additions & 2 deletions client/component/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ class Database extends React.Component {
<div className="redirection-database_error wpl-error">
<h3>{ __( 'Database problem' ) }</h3>

<p>{ error }</p>

<p>
<button className="button button-primary" onClick={ this.onSkip }>
{ __( 'Try again' ) }
Expand Down
52 changes: 34 additions & 18 deletions client/component/redirect-edit/warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ export const getWarningFromState = ( item ) => {
if ( url.match( /%\w+%/ ) ) {
warnings.push(
<ExternalLink url="tools.php?page=redirection.php&sub=site">
{ __(
'Please add migrated permalinks to the Site page under the "Permalink Migration" section.'
) }
{ __( 'Please add migrated permalinks to the Site page under the "Permalink Migration" section.' ) }
</ExternalLink>
);
}
Expand Down Expand Up @@ -134,6 +132,22 @@ export const getWarningFromState = ( item ) => {
);
}

if ( flag_regex && url.indexOf( '^' ) > 0 ) {
warnings.push(
__(
'The caret {{code}}^{{/code}} should be at the start. For example: {{code}}%(example)s{{/code}}',
{
components: {
code: <code />,
},
args: {
example: '^' + url.replace( '^', '' ),
},
}
)
);
}

// Redirect everything
if ( url === '/(.*)' || url === '^/(.*)' ) {
warnings.push(
Expand Down Expand Up @@ -182,22 +196,24 @@ export const getWarningFromState = ( item ) => {
);
}

targets.forEach( ( target ) => {
const matches = target.match( /[|\\\$]/g );
if ( flag_regex === false ) {
targets.forEach( ( target ) => {
const matches = target.match( /[|\\\$]/g );

if ( matches !== null ) {
warnings.push(
__( 'Your target URL contains the invalid character {{code}}%(invalid)s{{/code}}', {
components: {
code: <code />,
},
args: {
invalid: matches,
},
} )
);
}
} );
if ( matches !== null ) {
warnings.push(
__( 'Your target URL contains the invalid character {{code}}%(invalid)s{{/code}}', {
components: {
code: <code />,
},
args: {
invalid: matches,
},
} )
);
}
} );
}

// People often try and use a relative absolute domain - /something.com/
[ url, ...targets ].forEach( ( target ) => {
Expand Down
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-fa_IR.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.

Binary file modified locale/redirection-en_ZA.mo
Binary file not shown.
Loading

0 comments on commit a2af44b

Please sign in to comment.