@@ -53,7 +53,6 @@ public function __construct($auth)
53
53
{
54
54
$ this ->auth = $ auth ;
55
55
$ this ->params = $ this ->loadParams ();
56
-
57
56
$ this ->language = $ this ->params [$ _REQUEST ['auth ' ]['application_token ' ]]['LANGUAGE_ID ' ];
58
57
$ this ->messages = $ this ->loadMessages ();
59
58
}
@@ -85,7 +84,7 @@ public function uninstall()
85
84
{
86
85
$ configFileName = '/config_ ' . trim (str_replace ('. ' , '_ ' , $ _REQUEST ['auth ' ]['domain ' ])) . '.php ' ;
87
86
88
- if (file_exists ($ configFileName )) {
87
+ if (file_exists (__DIR__ . ' /../../../ ' . $ configFileName )) {
89
88
unlink ($ configFileName );
90
89
}
91
90
@@ -114,7 +113,7 @@ public function saveParams($params)
114
113
$ config = "<?php \n" ;
115
114
$ config .= "\return " . var_export ($ params , true ) . "; \n" ;
116
115
$ configFileName = '/config_ ' . trim (str_replace ('. ' , '_ ' , $ _REQUEST ['auth ' ]['domain ' ])) . '.php ' ;
117
- file_put_contents (__DIR__ . $ configFileName , $ config );
116
+ file_put_contents (__DIR__ . ' /../../../ ' . $ configFileName , $ config );
118
117
119
118
return true ;
120
119
}
@@ -169,8 +168,8 @@ protected function call($method, array $params = array())
169
168
protected function loadParams ()
170
169
{
171
170
$ configFileName = '/config_ ' . trim (str_replace ('. ' , '_ ' , $ _REQUEST ['auth ' ]['domain ' ])) . '.php ' ;
172
- if (file_exists (__DIR__ . $ configFileName )) {
173
- return include_once __DIR__ . $ configFileName ;
171
+ if (file_exists (realpath ( __DIR__ . ' /../../../ ' . $ configFileName) )) {
172
+ return include __DIR__ . ' /../../../ ' . $ configFileName ;
174
173
}
175
174
176
175
return false ;
@@ -183,8 +182,8 @@ protected function loadParams()
183
182
*/
184
183
protected function loadMessages ()
185
184
{
186
- if ($ this ->language != $ this ->default_language && file_exists (__DIR__ .'/messages/ ' .$ this ->language .'.php ' )) {
187
- return include __DIR__ .'/messages/ ' .$ this ->messages .'.php ' ;
185
+ if ($ this ->language != $ this ->default_language && file_exists (realpath ( __DIR__ .'/../../../ messages/ ' .$ this ->language .'.php ' ) )) {
186
+ return include __DIR__ .'/../../../ messages/ ' .$ this ->language .'.php ' ;
188
187
}
189
188
190
189
return [];
0 commit comments