Edit File by line
/home/barbar84/www/wp-conte.../plugins/wordpres.../src/helpers
File: string-helper.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Helpers;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* A helper object for string operations.
[5] Fix | Delete
*/
[6] Fix | Delete
class String_Helper {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Strips all HTML tags including script and style.
[10] Fix | Delete
*
[11] Fix | Delete
* @param string $string The string to strip the tags from.
[12] Fix | Delete
*
[13] Fix | Delete
* @return string The processed string.
[14] Fix | Delete
*/
[15] Fix | Delete
public function strip_all_tags( $string ) {
[16] Fix | Delete
return \wp_strip_all_tags( $string );
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* Standardize whitespace in a string.
[21] Fix | Delete
*
[22] Fix | Delete
* Replace line breaks, carriage returns, tabs with a space, then remove double spaces.
[23] Fix | Delete
*
[24] Fix | Delete
* @param string $string String input to standardize.
[25] Fix | Delete
*
[26] Fix | Delete
* @return string
[27] Fix | Delete
*/
[28] Fix | Delete
public function standardize_whitespace( $string ) {
[29] Fix | Delete
return \trim( \str_replace( ' ', ' ', \str_replace( [ "\t", "\n", "\r", "\f" ], ' ', $string ) ) );
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* First strip out registered and enclosing shortcodes using native WordPress strip_shortcodes function.
[34] Fix | Delete
* Then strip out the shortcodes with a filthy regex, because people don't properly register their shortcodes.
[35] Fix | Delete
*
[36] Fix | Delete
* @param string $text Input string that might contain shortcodes.
[37] Fix | Delete
*
[38] Fix | Delete
* @return string String without shortcodes.
[39] Fix | Delete
*/
[40] Fix | Delete
public function strip_shortcode( $text ) {
[41] Fix | Delete
return \preg_replace( '`\[[^\]]+\]`s', '', \strip_shortcodes( $text ) );
[42] Fix | Delete
}
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function