Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/sitepres.../lib/twig/src
File: FileExtensionEscapingStrategy.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* This file is part of Twig.
[3] Fix | Delete
*
[4] Fix | Delete
* (c) Fabien Potencier
[5] Fix | Delete
*
[6] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[7] Fix | Delete
* file that was distributed with this source code.
[8] Fix | Delete
*/
[9] Fix | Delete
namespace WPML\Core\Twig;
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Default autoescaping strategy based on file names.
[13] Fix | Delete
*
[14] Fix | Delete
* This strategy sets the HTML as the default autoescaping strategy,
[15] Fix | Delete
* but changes it based on the template name.
[16] Fix | Delete
*
[17] Fix | Delete
* Note that there is no runtime performance impact as the
[18] Fix | Delete
* default autoescaping strategy is set at compilation time.
[19] Fix | Delete
*
[20] Fix | Delete
* @author Fabien Potencier <fabien@symfony.com>
[21] Fix | Delete
*/
[22] Fix | Delete
class FileExtensionEscapingStrategy
[23] Fix | Delete
{
[24] Fix | Delete
/**
[25] Fix | Delete
* Guesses the best autoescaping strategy based on the file name.
[26] Fix | Delete
*
[27] Fix | Delete
* @param string $name The template name
[28] Fix | Delete
*
[29] Fix | Delete
* @return string|false The escaping strategy name to use or false to disable
[30] Fix | Delete
*/
[31] Fix | Delete
public static function guess($name)
[32] Fix | Delete
{
[33] Fix | Delete
if (\in_array(\substr($name, -1), ['/', '\\'])) {
[34] Fix | Delete
return 'html';
[35] Fix | Delete
// return html for directories
[36] Fix | Delete
}
[37] Fix | Delete
if ('.twig' === \substr($name, -5)) {
[38] Fix | Delete
$name = \substr($name, 0, -5);
[39] Fix | Delete
}
[40] Fix | Delete
$extension = \pathinfo($name, \PATHINFO_EXTENSION);
[41] Fix | Delete
switch ($extension) {
[42] Fix | Delete
case 'js':
[43] Fix | Delete
return 'js';
[44] Fix | Delete
case 'css':
[45] Fix | Delete
return 'css';
[46] Fix | Delete
case 'txt':
[47] Fix | Delete
return \false;
[48] Fix | Delete
default:
[49] Fix | Delete
return 'html';
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
\class_alias('WPML\\Core\\Twig\\FileExtensionEscapingStrategy', 'WPML\\Core\\Twig_FileExtensionEscapingStrategy');
[54] Fix | Delete
[55] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function