-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClientI18N.php
34 lines (31 loc) · 1.16 KB
/
ClientI18N.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
//Client @0-0C6F9A9D
define("RelativePath", ".");
define("PathToCurrentPage", "");
define("FileName", "");
include(RelativePath . "/Common.php");
$ClientFileEncoding = "UTF-8";
$AllowedFiles = array(
"/^DatePicker\\.js$/" => "content-type: text/javascript; charset=$ClientFileEncoding",
"/^Functions\\.js$/" => "content-type: text/javascript; charset=$ClientFileEncoding",
"/^[\\w\\/]+_events\\.js$/" => "content-type: text/javascript; charset=$ClientFileEncoding"
);
$file = CCGetFromGet("file");
foreach ($AllowedFiles as $FileMask => $FileType) {
if (preg_match($FileMask, $file)) {
$file_content = "";
$file_path = RelativePath . "/" . $file;
if (file_exists($file_path)) {
$fh = fopen($file_path, "rb");
if (filesize($file_path))
$file_content = fread($fh, filesize($file_path));
fclose($fh);
$file_content = preg_replace("/\\{res:\s*(\w+)\\}/ise", "CCConvertEncoding(\$CCSLocales->GetText('\\1'), \$FileEncoding, \$ClientFileEncoding)", $file_content);
}
header($FileType);
echo $file_content;
exit;
}
}
//End Client
?>