Extension talk:Include

From MediaWiki.org
Jump to: navigation, search
An archive box Archives 

/Archive 1

Start a new discussion

Contents

Thread titleRepliesLast modified
Mediawiki magic words inside src-parameter116:05, 24 May 2013
scrolling=no?118:16, 2 April 2013
Tranlate WikiSyntax012:22, 5 March 2012
Installtion instructions011:08, 11 December 2011
It does not work: Warning: Parameter 3 to render_include() expected to be a reference [solved]111:00, 11 December 2011
Local file timestamp?110:59, 11 December 2011
Included file doesnt update (solution: new keyword 'nocache')210:58, 11 December 2011
Maintainer change010:56, 11 December 2011
Why is this extension needed?011:02, 11 December 2011

Mediawiki magic words inside src-parameter

Is it possible to use Mediawiki magic words like PAGENAME inside the src-parameter? We are having a problem that the magic words aren't processed before the include is processed, which means that our php-page gets parameter PAGENAME instead of the true page name.

Expih (talk)11:01, 20 September 2012

Yes, I was able to get magicwords to work. For example: <include src="//www.mediawiki.org/w/search/{{#replace:{{#replace:Extension talk:Include/Mediawiki magic words inside src-parameter/reply|.pdf|.txt}}||%20}}"/>

98.195.63.17616:05, 24 May 2013
 

scrolling=no?

Is there a way to set scrolling="no" instead of the default "yes"?

203.35.229.12902:22, 2 April 2013

I just merged a patch doing this.

MatthieuMoy (talk)18:16, 2 April 2013
 

Tranlate WikiSyntax

Hello,

I install the extension, to upload a generate txt file into wiki. The txt file contains a wiki table. When I look at the page I see the source code of the table in a dotted rectangle. I want the table. Is there anywhere a space or something, which contains the content of the txt file?

Edit: Okay, read the instructions. Problem solved.

141.35.213.22112:16, 5 March 2012

Installtion instructions

Currently the instructions demonstrate to install it in the root of the extensions folder, This goes against the de-facto standard for extensions to create a new folder in the extensions folder self-named after the extension to house their file(s).

This should be fixed in both the WikiPage as well as the extension file, I would have done this but I'm a bit busy and can't be bothered to setup git and all that atm to do the pull/pushes/merge requests atm.

Peachey8811:08, 11 December 2011

It does not work: Warning: Parameter 3 to render_include() expected to be a reference [solved]

If your browser log file shows

[error] PHP Warning: Parameter 3 to render_include() expected to be a reference, value given in .../includes/parser/Parser.php on line 3333

you need to apply the

patch for PHP 5.3.x[edit | edit source]

--- secure-include.php.orig	2011-05-22 04:54:45.000000000 +0200
+++ secure-include.php	2011-05-22 04:53:16.000000000 +0200
@@ -669,7 +669,7 @@
  * @access public
  * @return string
  */
-function ef_include_render ( $input , $argv, &$parser )
+function ef_include_render ( $input , $argv, $parser )
 {
     global $highlighter_package;
     global $wg_include_allowed_features;
  • tested for MediaWiki trunk 1.19alpha (r88557) and PHP 5.3.6
--Wikinaut 03:03, 22 May 2011 (UTC)11:00, 11 December 2011

Applied, thanks.

--82.246.190.158 09:19, 22 May 2011 (UTC)11:00, 11 December 2011
 

Local file timestamp?

Is it possible to include a local file timestamp? To keep track when the file was last modified

--88.115.199.237 10:45, 21 January 2008 (UTC)10:58, 11 December 2011

done in version 0.10-beta ; a "nocache" option will also become available.

--Wikinaut 22:44, 28 May 2011 (UTC)10:59, 11 December 2011
 

Included file doesnt update (solution: new keyword 'nocache')

When I include a local file, it only updates when I edit and save page. How can I get it to update by just reloading the page?

-- 88.115.199.237 06:45, 18 January 2008 (UTC)10:57, 11 December 2011

This is a limitation of MediaWiki. Note that external content is only refreshed when you save the wiki page that contains the <include/>. Changing the external file WILL NOT update the wiki page until the wiki page is edited and saved (not merely refreshed in the browser). You can also instruct the server to refresh the page by adding the refresh action. See w:en:Wikipedia:Bypass_your_cache#Server_cache . You can add the following to a wiki page to make it easier to clear the cache //www.mediawiki.org/w/index.php?title=Thread:Extension_talk:Include/Included_file_doesnt_update_(solution:_new_keyword_%27nocache%27)/reply&action=purge

--Noahspurrier 23:28, 23 January 2008 (UTC)10:57, 11 December 2011

At the very end of the module, you could add these lines, which disables page caching when it finds "nocache" keyword as in <include ... nocache />. This will disable the cache for pages that use the include tag.

function ef_include_render( $input, $argv, $parser ) {
    ...
    # http://www.mediawiki.org/wiki/Extensions_FAQ#How_do_I_disable_caching_for_pages_using_my_extension.3F
    if ( !empty( $argv['nocache'] ) ) {
        $parser->disableCache();
    }
 
    return $output;
}

Such an option will be part of a new version of the extension. Another possibility is to install MagicNoCache and to add the magic word to your page, or to install one of the alternatives mentioned on bottom of that page.

--Wikinaut 06:42, 24 May 2011 (UTC)10:58, 11 December 2011
 
 

Maintainer change

The previous version of include.php contained a very severe security hole, allowing the inclusion of local files (like /etc/passwd & friends) even in the most paranoid configuration.

I've notified Noah (7 emails sent since july 2010, with different subjects and from different adresses, tried to use the online notification available at http://www.noah.org/cgi-bin/email but it's broken, left a security warning on the home page with a link to my webpage), but I got just one answer asking me to resend my code, which I did, several times. I hate doing this, but I'm hijacking this page to point to my version, to avoid leaving users of this extensions vulnerable to the security hole.

Noah, if you read this and whish to step back in as a maintainer, I'd be glad to let you do so.

--MatthieuMoy 17:01, 7 February 2011 (UTC)10:56, 11 December 2011

Why is this extension needed?

Please forgive me if I am incorrect. I am a newbie at programming.

As I added to the see also section:

If these extensions allow the editor to embed dynamic pages in a wiki, why use this extension which only allows an editor to add static (unchanging) text content?

With Iframe html, for example you can:

  1. edit a wiki inside of a wiki, or
  2. add external forum comments inside a page of your wiki.
  3. browse youtube on a page of your wiki.
  • This extension allows one to seamlessly integrate a piece of text or HTML within a page in addition to using iframes. I use it to include pieces of code, and the extension also does the syntax highlighting for me, it's basically great. Iframes are great too, but they do different things.
Adamtheclown 17:08, 24 November 2010 (UTC)11:01, 11 December 2011