-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathset-value.php
More file actions
82 lines (65 loc) · 1.9 KB
/
set-value.php
File metadata and controls
82 lines (65 loc) · 1.9 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
$dir = '';
if(isset($_POST['dir']))
$dir = @$_POST['dir'];
$dir = strip_tags(str_replace(array("\\", "/"), "", $dir));
$group = '';
if(isset($_POST['group']))
$group = @$_POST['group'];
$group = strip_tags(str_replace(array("\\", "/"), "", $group));
$module = '';
if(isset($_POST['module']))
$module = @$_POST['module'];
$module = strip_tags(str_replace(array("\\", "/"), "", $module));
$langref = '';
if(isset($_POST['langref']))
$langref = @$_POST['langref'];
$langref = strip_tags(str_replace(array("\\", "/"), "", $langref));
$lang2edit = '';
if(isset($_POST['lang2edit']))
$lang2edit = @$_POST['lang2edit'];
$lang2edit = strip_tags(str_replace(array("\\", "/"), "", $lang2edit));
$key = '';
if(isset($_POST['key']))
$key = @$_POST['key'];
$key = strip_tags(str_replace(array("\\", "/"), "", $key));
$value = '';
if(isset($_POST['value']))
$value = @$_POST['value'];
if(($dir == 'catalog' || $dir == 'admin') && $lang2edit != '' && $group != '' && $module != '')
{
$parent1 = dirname(__FILE__)."/upload/$dir/language/".$langref;
$parent2 = dirname(__FILE__)."/upload/$dir/language/".$lang2edit;
$data = array();
$_ = array();
$module_file2 = $parent2."/".$group."/".$module;
if($group == '---' && $module == '---')
{
$module_file2 = dirname(__FILE__)."/upload/$dir/language/$lang2edit/$lang2edit".".php";
}
if(file_exists($module_file2))
{
include $module_file2;
}
$_[$key] = $value;
$html = "<"."?php\r\n";
foreach($_ as $k=>$v)
{
$v = str_replace("\\", "\\\\", $v);
$v = str_replace("'", "\\'", $v);
$html .= "\$"."_"."['".$k."'] = '".$v."';\r\n";
}
$html .= "?".">";
if(!file_exists($parent2) && $group != '---' && $module != '---')
{
mkdir($parent2);
chmod($parent2, 755);
}
if(!file_exists($parent2."/".$group) && $group != '---' && $module != '---')
{
mkdir($parent2."/".$group);
chmod($parent2."/".$group, 755);
}
file_put_contents($module_file2, $html);
}
?>