X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=uploader.php;h=216091f111da40953d114b0eb3da47225c525c73;hp=0c962c205d38b9333076bbcdbc361cf68f065a71;hb=HEAD;hpb=ed5b82e026ec9a6f0fd844ba42fff3f268d949d3 diff --git a/uploader.php b/uploader.php index 0c962c2..216091f 100644 --- a/uploader.php +++ b/uploader.php @@ -1,9 +1,15 @@ load('code/wfpl/uploader/uploader.html'); + $html->load(__DIR__.'/'.'uploader/uploader.html'); $html->set('filename', $filename); $html->set('host', $GLOBALS['wfpl_uploader_host']); $html->set('port', $GLOBALS['wfpl_uploader_port']); $html->show('main'); $html = $html->get('main'); - $css = read_whole_file('code/wfpl/uploader/uploader.css'); + $css = read_whole_file(__DIR__.'/'.'uploader/uploader.css'); $javascript = new tem(); - $javascript->load('code/wfpl/uploader/progress.js'); + $javascript->load(__DIR__.'/'.'uploader/progress.js'); $javascript->set('url', $progress_url); $javascript = $javascript->run(); @@ -64,7 +70,7 @@ function uploader_move($tmp_filename, $filename) { # start a daemon to accept file uploads and give progress indicators # if the port is used (eg if the daemon is already running) this will do nothing. function uploader_daemon_start($port) { - exec(path_to('tcpserver') . " -q -R -H -llocalhost 0 $port " . path_to('perl') . ' code/wfpl/uploader/daemon.pl ' . $GLOBALS['wfpl_uploader_path'] . ' >/dev/null 2>/dev/null < /dev/null &'); + exec(path_to('tcpserver') . " -q -R -H -llocalhost 0 $port " . path_to('perl') . ' lib/wfpl/uploader/daemon.pl ' . $GLOBALS['wfpl_uploader_path'] . ' >/dev/null 2>/dev/null < /dev/null &'); } /* call this to respond to the javascript async request for progress on the upload */ @@ -78,8 +84,8 @@ function wfpl_uploader_progress() { $file = $_REQUEST['wfpl_upload_progress']; $file = strtolower($file); - $file = ereg_replace('[^a-z0-9.-]', '_', $file); - $file = ereg_replace('^[.-]', '_', $file); + $file = preg_replace('|[^a-z0-9.-]|', '_', $file); + $file = preg_replace('|^[.-]|', '_', $file); $file = $GLOBALS['wfpl_uploader_path'] . "/progress/$file"; $waited = 0;