Configurar plugins. // // El orden importa: lo de aqui arriba es el DEFAULT de una web recien creada // y el checkpoint va DESPUES, para que el plugin — cuando este instalado y // activo — pueda apagar tambien lo que se haya encendido aqui. Sin el plugin, // la web se comporta como siempre: solo cache local de consultas. // define("USE_INFORMATION_SCHEMA_CACHE", true); // CocoDB::$noCacheURIS = ["\\/mi(s)?-(.*)(\\/)(.*)","\\/hooks\\/(.*)?","\\/login\\/(.*)?"]; // CocoDB::$noCacheTABLES = ["aux_plg_payments","cms_cestas_abandonadas","cms_direcciones","cms_posibles_pedidos","cms_stock","cms_usuarios_metas","cms_usuarios"]; // // // Cache general de consultas en Redis // CocoDB::fullCache(3); // // Cache local: cachea las consultas repetidas dentro de la misma peticion CocoDB::localCache(); // // CocoDB::$force_redis_module = @CocoDB::bloquedCacheByURL($_SERVER["REQUEST_URI"]) ? false : true; // CocoDB::$force_redis_html = @CocoDB::bloquedCacheByURL($_SERVER["REQUEST_URI"]) ? false : true; $cacheHandlerVars = array("uri" => @$_SERVER["REQUEST_URI"]); if (function_exists("addPlugins")) addPlugins("cache", $cacheHandlerVars); $plantilla = "template/estandar"; define("PLANTILLA",$plantilla); define("RUTA_PLANTILLA","/".$plantilla); if (@$_REQUEST["idioma"]=="es") $_REQUEST["idioma"] = ""; if (substr($_SERVER["REQUEST_URI"],0,4)=="/en/") $_REQUEST["idioma"]="en"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/es/") $_REQUEST["idioma"]="es"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/de/") $_REQUEST["idioma"]="de"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/fr/") $_REQUEST["idioma"]="fr"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/pt/") $_REQUEST["idioma"]="pt"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/se/") $_REQUEST["idioma"]="se"; if (substr($_SERVER["REQUEST_URI"],0,5)=="/cat/") $_REQUEST["idioma"]="cat"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/it/") $_REQUEST["idioma"]="it"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/ko/") $_REQUEST["idioma"]="ko"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/ch/") $_REQUEST["idioma"]="ch"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/nu/") $_REQUEST["idioma"]="nu"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/ru/") $_REQUEST["idioma"]="ru"; if (substr($_SERVER["REQUEST_URI"],0,4)=="/ni/") $_REQUEST["idioma"]="ni"; // Seguridad: el idioma puede llegar crudo por ?idioma= (la query string se // reenvia entera a slug.php via .htaccess). Se refleja sin escapar en varias // plantillas (RUTA_RAIZ/ROOT, lang="...", vars JS) -> XSS reflejado. Se valida // contra un allowlist antes de definir constantes y renderizar: cualquier // valor que no sea un idioma conocido se descarta. $__idiomasValidos = array("en","es","de","fr","pt","se","cat","it","ko","ch","nu","ru","ni"); if (!in_array(@$_REQUEST["idioma"], $__idiomasValidos, true)) $_REQUEST["idioma"] = ""; if (@$_REQUEST["idioma"]) define("RUTA_RAIZ","/".$_REQUEST["idioma"]); else define("RUTA_RAIZ",""); if (@$_REQUEST["idioma"]) define("ROOT","/".$_REQUEST["idioma"]); else define("ROOT",""); ?>