Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
source/export formats
Avatar
atrasatti #1
Member since Oct 2006 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: source/export formats
In my Wiki installation I have disabled the possibility to see the original source or to export as HTML. I did this from the configuration panel.

In my daily logs I saw many requests to download the exported version. Looking at the page source I noticed that while the exported version is disabled, a <link> element with the alternate attribute is still present both for HTML and RAW formats.
Trying to reach the suggested URL's presents an error (as expected).

I modified template.php, at line 192. These are the changes I applied:
    if ( actionOK('source') ) {
          $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/html', 'title'=>'Plain HTML',
                             'href'=>exportlink($ID, 'xhtml', '', false, '&'));
    }
    if ( actionOK('export_raw') ) {
          $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/plain', 'title'=>'Wiki Markup',
                             'href'=>exportlink($ID, 'raw', '', false, '&'));
    }

Now the <link> element for RAW and HTML versions only appears if configured so.

Also, I believe that it's odd to call "source" the HTML version, while RAW seems appropriate. Using 'xhtml' as parameter for the method exportlink sounds odd too, since it's supposed to generate HTML.

- Andrea
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-23, 05:46:38 (UTC +02:00)