]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
Ability to enable/disable downloading images
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Event / Subscriber / DownloadImagesSubscriber.php
index 0792653e061740afed7e6e737f71f4e190a886d2..3f2d460c1ef7a3684f4e513336b881068070b77f 100644 (file)
@@ -52,6 +52,10 @@ class DownloadImagesSubscriber implements EventSubscriber
         $config = new $this->configClass();
         $config->setEntityManager($args->getEntityManager());
 
+        if (!$config->get('download_images_enabled')) {
+            return;
+        }
+
         // field content has been updated
         if ($args->hasChangedField('content')) {
             $html = $this->downloadImages($config, $entity);
@@ -87,6 +91,10 @@ class DownloadImagesSubscriber implements EventSubscriber
         $config = new $this->configClass();
         $config->setEntityManager($args->getEntityManager());
 
+        if (!$config->get('download_images_enabled')) {
+            return;
+        }
+
         // update all images inside the html
         $html = $this->downloadImages($config, $entity);
         if (false !== $html) {