File tree 2 files changed +18
-10
lines changed
prestashop1.7/controllers/admin
prestashop8.x/controllers/admin
2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -320,16 +320,20 @@ private function processSetOptions(string $params): array
320
320
break ;
321
321
}
322
322
323
- try {
324
- if (strlen (trim ($ value )) !== 40 ) {
325
- throw new Exception ('Invalid API key. Please provide value with 40 characters ' );
326
- }
323
+ $ value = trim ($ value );
324
+
325
+ if (strlen ($ value ) !== 40 ) {
326
+ throw new Exception ('Invalid API key. ' );
327
+ }
327
328
329
+ try {
328
330
$ jsonOpts ['js_api_key ' ] = $ this ->encryptData ($ value );
329
331
} catch (Exception $ e ) {
332
+ error_log ($ e ->getMessage ());
333
+
330
334
unset($ jsonOpts ['js_api_key ' ]);
331
335
332
- throw new Exception ('Javascript API Key: ' . $ e -> getMessage () );
336
+ throw new Exception ('Error saving Javascript API Key. ' );
333
337
}
334
338
335
339
break ;
Original file line number Diff line number Diff line change @@ -320,16 +320,20 @@ private function processSetOptions(string $params): array
320
320
break ;
321
321
}
322
322
323
- try {
324
- if (strlen (trim ($ value )) !== 40 ) {
325
- throw new Exception ('Invalid API key. Please provide value with 40 characters ' );
326
- }
323
+ $ value = trim ($ value );
324
+
325
+ if (strlen ($ value ) !== 40 ) {
326
+ throw new Exception ('Invalid API key. ' );
327
+ }
327
328
329
+ try {
328
330
$ jsonOpts ['js_api_key ' ] = $ this ->encryptData ($ value );
329
331
} catch (Exception $ e ) {
332
+ error_log ($ e ->getMessage ());
333
+
330
334
unset($ jsonOpts ['js_api_key ' ]);
331
335
332
- throw new Exception ('Javascript API Key: ' . $ e -> getMessage () );
336
+ throw new Exception ('Error saving Javascript API Key. ' );
333
337
}
334
338
335
339
break ;
You can’t perform that action at this time.
0 commit comments