summaryrefslogtreecommitdiffstats
path: root/system/application/controllers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-02-27 21:20:06 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-02-27 21:23:01 +0100
commit6ffac5d6ecd013988961e0ee914bf086519b52d5 (patch)
treeccfd186fb321ccda9edc69b6bb43ad9869f9664e /system/application/controllers
parent7bb325ba0df707d6de6501a00527ebac457f3e0f (diff)
change comment for line numbers
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application/controllers')
-rw-r--r--system/application/controllers/file.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/system/application/controllers/file.php b/system/application/controllers/file.php
index ba231d47f..37658ea19 100644
--- a/system/application/controllers/file.php
+++ b/system/application/controllers/file.php
@@ -171,7 +171,8 @@ class File extends Controller {
$data['raw_link'] = site_url($this->config->item('paste_download_url').$id);
header("Content-Type: text/html\n");
echo $this->load->view('file/html_header', $data, true);
- // TODO: implement in PHP
+ // only rewrite if it's fast
+ // count(file($file)); isn't
echo shell_exec('/usr/bin/seq 1 $(/usr/bin/wc -l '.escapeshellarg($file).' | /bin/cut -d\ -f1) | sed -r \'s/^(.*)$/<a href="#n\1" class="no" name="n\1" id="n\1">\1<\/a>/g\'');
echo '</pre></td><td class="code"><pre>'."\n";
echo shell_exec(FCPATH.'scripts/syntax-highlighting.sh '.$filedata['filename'].'.'.$mode.' < '.escapeshellarg($file));