← All changes
|
admin/controllers/WooMailerLiteAdminWizardController.php
+4
-4
3.1.18
→
trunk
View file →
| @@ -193,13 +193,13 @@ | ||
| 193 | 193 | return false; |
| 194 | 194 | } |
| 195 | 195 | public function getDebugLogs() |
| 196 | 196 | { |
| 197 | - $this->authorize(); | |
| 197 | + $this->authorize(); | |
| 198 | 198 | if (!function_exists('shell_exec')) { |
| 199 | 199 | return $this->response(['log' => 'Please enable shell_exec function in your php config.'], 200); |
| 200 | 200 | } |
| 201 | - | |
| 201 | + | |
| 202 | 202 | $errorPath = escapeshellarg(ini_get('error_log')); |
| 203 | 203 | $log = ''; |
| 204 | 204 | if(!empty($errorPath)) { |
| 205 | 205 | $log = shell_exec("tail -500 {$errorPath}"); |
| @@ -229,12 +229,12 @@ | ||
| 229 | 229 | '/consumer_?key["\']?\s*[:=]\s*["\']?[^"\'\s]+["\']?/i' => 'consumer_key: [REDACTED]', |
| 230 | 230 | '/Bearer\s+[a-zA-Z0-9_-]+/i' => 'Bearer [REDACTED]', |
| 231 | 231 | '/Authorization:\s*[^\n]+/i' => 'Authorization: [REDACTED]', |
| 232 | 232 | ]; |
| 233 | - | |
| 233 | + | |
| 234 | 234 | foreach ($patterns as $pattern => $replacement) { |
| 235 | 235 | $log = preg_replace($pattern, $replacement, $log); |
| 236 | 236 | } |
| 237 | - | |
| 237 | + | |
| 238 | 238 | return $log; |
| 239 | 239 | } |
| 240 | 240 | } |