diff --git a/admin/modify_ads.php b/admin/modify_ads.php
index 8c6080d..7ee5362 100644
--- a/admin/modify_ads.php
+++ b/admin/modify_ads.php
@@ -45,13 +45,19 @@ function index()
$photo_thumb_dir = $GLOBALS['xoopsModuleConfig']['adslight_path_upload'] . '/thumbs';
$photo_resized_dir = $GLOBALS['xoopsModuleConfig']['adslight_path_upload'] . '/midsize';
if (!is_dir($photo_dir)) {
- mkdir($photo_dir);
+ if (!mkdir($photo_dir) && !is_dir($photo_dir)) {
+ throw new \RuntimeException(sprintf('Directory "%s" was not created', $photo_dir));
+ }
}
if (!is_dir($photo_thumb_dir)) {
- mkdir($photo_thumb_dir);
+ if (!mkdir($photo_thumb_dir) && !is_dir($photo_thumb_dir)) {
+ throw new \RuntimeException(sprintf('Directory "%s" was not created', $photo_thumb_dir));
+ }
}
if (!is_dir($photo_resized_dir)) {
- mkdir($photo_resized_dir);
+ if (!mkdir($photo_resized_dir) && !is_dir($photo_resized_dir)) {
+ throw new \RuntimeException(sprintf('Directory "%s" was not created', $photo_resized_dir));
+ }
}
if (!is_writable($photo_dir) || !is_readable($photo_dir)) {
echo "