Skip to content

Commit fa77bfb

Browse files
committed
Fix. Enqueue. Added check for 'allow_url_fopen' before processing script paths to prevent errors when the setting is disabled.
1 parent 0a4fd9a commit fa77bfb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/Cleantalk/Common/Enqueue/Enqueue.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ private function validateWebPath($path)
288288
$this->errorLog(__('Web path for script is invalid: ' . $path, 'cleantalk-spam-protect'));
289289
return $path;
290290
}
291+
if (!ini_get('allow_url_fopen')) {
292+
return $path;
293+
}
291294
$abs_path = str_replace($this->assets_path, $this->plugin_path, $path);
292295
if (!@file_exists($abs_path) && !@file_get_contents($abs_path)) {
293296
$this->errorLog(__('Script file is not accessible:' . $path, 'cleantalk-spam-protect'));

0 commit comments

Comments
 (0)