JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
db_upgrade rework, admin_header, cleanup
[wfpl-cms.git] / cms_images_autoresize.php
index 922b3cf..0d3e667 100644 (file)
@@ -1,8 +1,7 @@
 <?php
 
-define('DOCROOT', __DIR__ .'/');
-require_once(DOCROOT . 'config.php');
-require_once(DOCROOT . 'inc/wfpl/upload.php');
+require_once(__DIR__.'/'.'config.php');
+require_once(__DIR__.'/'.'inc/wfpl/upload.php');
 
 function cms_images_autoresize_main_abort_404() {
        http_response_code('404');
@@ -26,8 +25,8 @@ function cms_images_autoresize_main() {
        $width = (int)$matches[2];
        $ext = $matches[3];
        $in_fn = "$basename.$ext";
-       $in_path = DOCROOT . 'cms_images/' . $in_fn;
-       $out_path = DOCROOT . 'cms_images/' . $out_fn;
+       $in_path = __DIR__.'/'.'cms_images/' . $in_fn;
+       $out_path = __DIR__.'/'.'cms_images/' . $out_fn;
        $lock_path = $out_path . '.lock';
 
        if (!in_array($width, $GLOBALS['wfpl_image_widths'], true)) {