~ubuntu-branches/ubuntu/maverick/mahara/maverick-updates

« back to all changes in this revision

Viewing changes to htdocs/artefact/file/lib.php

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2008-09-29 13:00:12 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080929130012-7swv3jiomgpsm4b8
Tags: 1.0.5-1
* New Upstream Version
* Fix comments in maintainer scripts (closes: #491924)
* Add lintian override for embedded copies of mochikit
* Bump debhelper compatibility to 7 to use dh_lintian

Show diffs side-by-side

added added

removed removed

Lines of Context:
881
881
        return $record->id;
882
882
    }
883
883
 
 
884
    // append the view id to to the end of image and anchor urls so they are visible to logged out users also
 
885
    public static function append_view_url($postcontent, $view_id) {
 
886
        $postcontent = preg_replace('#(<a[^>]+href="[^>]+artefact/file/download\.php\?file=\d+)#', '\1&amp;view=' . $view_id , $postcontent);
 
887
        $postcontent = preg_replace('#(<img[^>]+src="[^>]+artefact/file/download\.php\?file=\d+)#', '\1&amp;view=' . $view_id, $postcontent);
 
888
        $postcontent = preg_replace('#(<img[^>]+src="([^>]+artefact/file/download\.php\?file=\d+&amp;view=\d+)"[^>]*>)#', '<a href="\2">\1</a>', $postcontent);
 
889
 
 
890
        return $postcontent;
 
891
    }
 
892
 
884
893
    public static function get_links($id) {
885
894
        $wwwroot = get_config('wwwroot');
886
895