From 1104ea8fea5098ff0ef5e6388d5fdf353784f679 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 17 Dec 2011 23:18:18 +0100 Subject: use perl from PATH and copy markdown.pl to scripts/ Signed-off-by: Florian Pritz --- application/models/file_mod.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'application/models/file_mod.php') diff --git a/application/models/file_mod.php b/application/models/file_mod.php index f6ad6d8f4..f2a1b21f6 100644 --- a/application/models/file_mod.php +++ b/application/models/file_mod.php @@ -12,7 +12,6 @@ class File_mod extends CI_Model { function __construct() { parent::__construct(); - putenv("PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"); } // Returns an unused ID @@ -96,7 +95,7 @@ class File_mod extends CI_Model { // TODO: Should only update not insert; see new_id() function add_file($hash, $id, $filename) { - $mimetype = exec("/usr/bin/perl ".FCPATH.'scripts/mimetype '.escapeshellarg($filename).' '.escapeshellarg($this->file($hash))); + $mimetype = exec("perl ".FCPATH.'scripts/mimetype '.escapeshellarg($filename).' '.escapeshellarg($this->file($hash))); $query = $this->db->query(' INSERT INTO `files` (`hash`, `id`, `filename`, `password`, `date`, `mimetype`) VALUES (?, ?, ?, ?, ?, ?)', @@ -246,7 +245,7 @@ class File_mod extends CI_Model { if ($mode == "qr") { header("Content-disposition: inline; filename=\"".$id."_qr.png\"\n"); header("Content-Type: image/png\n"); - passthru('/usr/bin/qrencode -s 10 -o - '.escapeshellarg(site_url($id).'/')); + passthru('qrencode -s 10 -o - '.escapeshellarg(site_url($id).'/')); exit(); } @@ -291,15 +290,15 @@ class File_mod extends CI_Model { ob_start(); if ($mode == "rmd") { echo ''."\n"; - passthru('/usr/bin/perl /usr/bin/vendor_perl/Markdown.pl '.escapeshellarg($file)); + passthru('perl '.FCPATH.'scripts/Markdown.pl '.escapeshellarg($file)); } elseif ($mode == "ascii") { echo '
'."\n";
-				passthru('/usr/bin/perl '.FCPATH.'scripts/ansi2html '.escapeshellarg($file));
+				passthru('perl '.FCPATH.'scripts/ansi2html '.escapeshellarg($file));
 				echo "
\n"; } else { echo '
';
 				// generate line numbers (links)
-				passthru('/usr/bin/perl -ne \'print "$.\n"\' '.escapeshellarg($file));
+				passthru('perl -ne \'print "$.\n"\' '.escapeshellarg($file));
 				echo '
'."\n"; $this->load->library('geshi'); $this->geshi->initialize(array('set_language' => $mode, 'set_source' => file_get_contents($file), 'enable_classes' => 'true')); -- cgit v1.2.3-24-g4f1b