the homepage for invalid searches. * * @param string $reason The reason for redirecting away. * @param string $to_url The URL to redirect to. * * @return void */ private function redirect_away( $reason, $to_url = '' ) { if ( empty( $to_url ) ) { $to_url = \get_home_url(); } $this->redirect_helper->do_safe_redirect( $to_url, 301, 'Yoast Search Filtering: ' . $reason ); } /** * Limits the number of characters in the search query. * * @return void */ private function limit_characters() { // We retrieve the search term unescaped because we want to count the characters properly. We make sure to escape it afterwards, if we do something with it. $unescaped_s = \get_search_query( false ); // We then unslash the search term, again because we want to count the characters properly. We make sure to slash it afterwards, if we do something with it. $raw_s = \wp_unslash( $unescaped_s ); if ( \mb_strlen( $raw_s, 'UTF-8' ) > $this->options_helper->get( 'search_character_limit' ) ) { $new_s = \mb_substr( $raw_s, 0, $this->options_helper->get( 'search_character_limit' ), 'UTF-8' ); \set_query_var( 's', \wp_slash( \esc_attr( $new_s ) ) ); } } /** * Determines if a text string contains an emoji or not. * * @param string $text The text string to detect emoji in. * * @return bool */ private function has_emoji( $text ) { $emojis_regex = '/([^-\p{L}\x00-\x7F]+)/u'; \preg_match( $emojis_regex, $text, $matches ); return ! empty( $matches ); } } {"version":"1.0","provider_name":"","provider_url":"https:\/\/www.gosigmalogistics.com","title":"Top-Rated Brookfield, VT Cold Storage -","type":"rich","width":600,"height":338,"html":"
Top-Rated Brookfield, VT Cold Storage<\/a><\/blockquote>