@@ -128,6 +128,9 @@ public function config_file_valid()
128128 if (!defined ('OB_HASH_SALT ' )) {
129129 $ errors [] = 'OB_HASH_SALT (password hash salt) not set. ' ;
130130 }
131+ if (!defined ('OB_UPLOADS ' )) {
132+ $ errors [] = 'OB_UPLOADS (uploads directory) not set. ' ;
133+ }
131134 if (!defined ('OB_MEDIA ' )) {
132135 $ errors [] = 'OB_MEDIA (media directory) not set. ' ;
133136 }
@@ -236,6 +239,12 @@ public function directories_valid()
236239 {
237240 $ errors = [];
238241
242+ if (!is_dir (OB_UPLOADS )) {
243+ $ errors [] = 'OB_UPLOADS (uploads directory) is not a valid directory. ' ;
244+ } elseif (!is_writable (OB_UPLOADS )) {
245+ $ errors [] = 'OB_UPLOADS (uploads directory) is not writable by the server. ' ;
246+ }
247+
239248 if (!is_dir (OB_MEDIA )) {
240249 $ errors [] = 'OB_MEDIA (media directory) is not a valid directory. ' ;
241250 } elseif (!is_writable (OB_MEDIA )) {
@@ -266,16 +275,10 @@ public function directories_valid()
266275 $ errors [] = 'OB_CACHE (cache directory) is not writable by the server. ' ;
267276 }
268277
269- if (!is_dir (OB_UPLOADS )) {
270- $ errors [] = 'The uploads directory does not exist. ' ;
271- } elseif (!is_writable (OB_UPLOADS )) {
272- $ errors [] = 'The uploads directory is not writable by the server. ' ;
273- }
274-
275278 if (count ($ errors ) == 0 ) {
276279 // make sure there are no directories specified within the OB_CACHE directory
277280 $ cache = realpath (OB_CACHE );
278- foreach ([OB_MEDIA , OB_MEDIA_UNAPPROVED , OB_MEDIA_ARCHIVE , OB_THUMBNAILS , OB_UPLOADS ] as $ dir ) {
281+ foreach ([OB_UPLOADS , OB_MEDIA , OB_MEDIA_UNAPPROVED , OB_MEDIA_ARCHIVE , OB_THUMBNAILS , OB_UPLOADS ] as $ dir ) {
279282 if (strpos (realpath ($ dir ), $ cache ) === 0 ) {
280283 $ errors [] = 'Directory ' . $ dir . ' is within the cache directory. ' ;
281284 }
0 commit comments