Server IP : 104.21.14.48 / Your IP : 18.191.174.159 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wordpress-seo/src/helpers/ |
Upload File : |
<?php namespace Yoast\WP\SEO\Helpers; /** * A helper object for string operations. */ class String_Helper { /** * Strips all HTML tags including script and style. * * @param string $text The text to strip the tags from. * * @return string The processed string. */ public function strip_all_tags( $text ) { return \wp_strip_all_tags( $text ); } /** * Standardize whitespace in a string. * * Replace line breaks, carriage returns, tabs with a space, then remove double spaces. * * @param string $text Text input to standardize. * * @return string */ public function standardize_whitespace( $text ) { return \trim( \str_replace( ' ', ' ', \str_replace( [ "\t", "\n", "\r", "\f" ], ' ', $text ) ) ); } /** * First strip out registered and enclosing shortcodes using native WordPress strip_shortcodes function. * Then strip out the shortcodes with a filthy regex, because people don't properly register their shortcodes. * * @param string $text Input string that might contain shortcodes. * * @return string String without shortcodes. */ public function strip_shortcode( $text ) { return \preg_replace( '`\[[^\]]+\]`s', '', \strip_shortcodes( $text ) ); } }