Merged in feature/MAW-855-import-code-into-aws (pull request #2)
code import from pantheon * code import from pantheon
This commit is contained in:
@@ -167,7 +167,7 @@ class WPSEO_Premium_Import_Manager implements WPSEO_WordPress_Integration {
|
||||
*
|
||||
* @param array $result The import result.
|
||||
*
|
||||
* @return void.
|
||||
* @return void
|
||||
*/
|
||||
protected function set_import_success( array $result ) {
|
||||
$this->import->success = true;
|
||||
@@ -330,7 +330,13 @@ class WPSEO_Premium_Import_Manager implements WPSEO_WordPress_Integration {
|
||||
* @return string The posted htaccess.
|
||||
*/
|
||||
protected function get_posted_htaccess() {
|
||||
return stripcslashes( filter_input( INPUT_POST, 'htaccess' ) );
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are validating a nonce here.
|
||||
if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wpseo-import' )
|
||||
&& isset( $_POST['htaccess'] ) && is_string( $_POST['htaccess'] ) ) {
|
||||
return sanitize_text_field( wp_unslash( $_POST['htaccess'] ) );
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,13 +347,14 @@ class WPSEO_Premium_Import_Manager implements WPSEO_WordPress_Integration {
|
||||
* @return string|null The posted import plugin.
|
||||
*/
|
||||
protected function get_posted_import_plugin() {
|
||||
$wpseo_post = filter_input( INPUT_POST, 'wpseo', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
|
||||
|
||||
if ( ! isset( $wpseo_post['import_plugin'] ) ) {
|
||||
return null;
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are validating a nonce here.
|
||||
if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wpseo-import' )
|
||||
&& isset( $_POST['wpseo'] ) && is_array( $_POST['wpseo'] )
|
||||
&& isset( $_POST['wpseo']['import_plugin'] ) && is_string( $_POST['wpseo']['import_plugin'] ) ) {
|
||||
return sanitize_text_field( wp_unslash( $_POST['wpseo']['import_plugin'] ) );
|
||||
}
|
||||
|
||||
return $wpseo_post['import_plugin'];
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user