Browse code

Only log missing member fragment or wrong syntax in debug mode

Benjamin Roth authored on17/12/2025 09:35:41
Showing1 changed files
... ...
@@ -191,7 +191,10 @@ class SecureDownloadsJob
191 191
                 // Extract member identifier from filename using regex
192 192
                 if (!preg_match('/'.$Configurations->regexp.'/U',$objFile->filename,$fragments))
193 193
                 {
194
-                    $this->logger->log(LogLevel::WARNING, sprintf('File "%s" is missing a member fragment or has the wrong syntax.', $objFile->name), array('contao' => new ContaoContext(__METHOD__, 'ERROR')));
194
+                    if (System::getContainer()->getParameter('kernel.debug'))
195
+                    {
196
+                        $this->logger->log(LogLevel::WARNING, sprintf('File "%s" is missing a member fragment or has the wrong syntax.', $objFile->name), array('contao' => new ContaoContext(__METHOD__, 'ERROR')));
197
+                    }
195 198
                     continue;
196 199
                 }
197 200