Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/StoreApi/Utilitie...
File: SanitizationUtils.php
<?php
[0] Fix | Delete
namespace Automattic\WooCommerce\StoreApi\Utilities;
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* SanitizationUtils class.
[4] Fix | Delete
* Helper class which sanitizes customer info.
[5] Fix | Delete
*/
[6] Fix | Delete
class SanitizationUtils {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Runs wp_kses on an array. This function runs wp_kses on strings in the array and recurses into arrays.
[10] Fix | Delete
*
[11] Fix | Delete
* @param array $array The array to run wp_kses on.
[12] Fix | Delete
* @return mixed The array, all string keys will have been run through wp_kses.
[13] Fix | Delete
*/
[14] Fix | Delete
public function wp_kses_array( array $array ) {
[15] Fix | Delete
foreach ( $array as $key => $value ) {
[16] Fix | Delete
if ( empty( $value ) ) {
[17] Fix | Delete
$array[ $key ] = $value;
[18] Fix | Delete
continue;
[19] Fix | Delete
}
[20] Fix | Delete
if ( is_array( $value ) ) {
[21] Fix | Delete
$array[ $key ] = $this->wp_kses_array( $value );
[22] Fix | Delete
}
[23] Fix | Delete
if ( is_string( $value ) ) {
[24] Fix | Delete
$array[ $key ] = wp_kses( $value, [] );
[25] Fix | Delete
}
[26] Fix | Delete
}
[27] Fix | Delete
return $array;
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function