diff --git a/source/php/Module.php b/source/php/Module.php index ce11d1ce1..1b4fe8956 100644 --- a/source/php/Module.php +++ b/source/php/Module.php @@ -537,6 +537,11 @@ private function getWidgetNames($widget): array|false { */ public function getShortcodeModules($post_id): array { + if(is_numeric($post_id) === false || $post_id <= 0) { + return []; + } + + $post_id = intval($post_id); $post = WpService::get()->getPost($post_id); $pattern = WpService::get()->getShortcodeRegex(); $modules = array();