HEX
Server: Apache
System: Linux webm020.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: bohousj (181416)
PHP: 8.4.22
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/b/o/h/bohousj/www/wp-content/plugins/wp-fastest-cache-premium/pro/library/mobile-cache.php
<?php
	class WpFcMobileCache{
		private $folder_name = "wpfc-mobile-cache";
		private $wptouch = false;

		public function __construct(){

		}

		public function set_wptouch($status){
			$this->wptouch = $status;
		}

		public function update_htaccess($data){
			preg_match("/RewriteEngine\sOn(.+)/is", $data, $out);
			$htaccess = "\n##### mobile #####\n";
			$htaccess .= $out[0];

			if($this->wptouch){
				$wptouch_rule = "RewriteCond %{HTTP:Cookie} !wptouch-pro-view=desktop";
				$htaccess = str_replace("RewriteCond %{HTTP:Profile}", $wptouch_rule."\n"."RewriteCond %{HTTP:Profile}", $htaccess);
			}

			$htaccess = str_replace("RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil", "RewriteCond %{HTTP:Cookie} !safirmobilswitcher=masaustu", $htaccess);
			$htaccess = str_replace("RewriteCond %{HTTP_USER_AGENT} !^.*", "RewriteCond %{HTTP_USER_AGENT} ^.*", $htaccess);
			$htaccess = preg_replace("/\/cache\/all\//", "/cache/".$this->get_folder_name()."/", $htaccess);

			//$htaccess = preg_replace("/(\/cache\/)[^\/]+(\/.{1}1\/index\.html)/","$1".$this->get_folder_name()."$2", $htaccess);
			$htaccess .= "\n##### mobile #####\n";

			return $htaccess;
		}

		public function get_folder_name(){
			return $this->folder_name;
		}
	}
?>