r111702 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111701‎ | r111702 | r111703 >
Date:23:35, 16 February 2012
Author:wikinaut
Status:deferred (Comments)
Tags:
Comment:
initial import of small Suhosin extension which checks and adapts MediaWiki to an running Suhosin extension (Hardened-PHP Project)
Modified paths:
  • /trunk/extensions/Suhosin (added) (history)
  • /trunk/extensions/Suhosin/Suhosin.i18n.php (added) (history)
  • /trunk/extensions/Suhosin/Suhosin.php (added) (history)

Diff [purge]

Index: trunk/extensions/Suhosin/Suhosin.i18n.php
@@ -0,0 +1,20 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for extension Suhosin
 5+ * @file
 6+ * @ingroup Extensions
 7+ * @author Thomas Gries
 8+ */
 9+
 10+$messages = array();
 11+
 12+/** English
 13+ * @author Thomas Gries
 14+ */
 15+$messages['en'] = array(
 16+ 'suhosin-desc' => 'Adapts MediaWiki settings within limits of an activated "Suhosin" extension (Hardened-PHP Project).',
 17+);
 18+
 19+/** Message documentation (Message documentation) */
 20+$messages['qqq'] = array(
 21+);
Property changes on: trunk/extensions/Suhosin/Suhosin.i18n.php
___________________________________________________________________
Added: svn:mime-type
122 + text/x-php
Added: svn:keywords
223 + Author Date Id Rev URL
Added: svn:eol-style
324 + native
Index: trunk/extensions/Suhosin/Suhosin.php
@@ -0,0 +1,62 @@
 2+<?php
 3+/**
 4+ * Suhosin extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ *
 9+ * The extension adapts MediaWiki settings to corresponding settings
 10+ * of php.ini for Hardened-PHP Project ("Suhosin extension")
 11+ *
 12+ * Installation:
 13+ *
 14+ * Add the following line in LocalSettings.php:
 15+ * require_once( "$IP/extensions/Suhosin/Suhosin.php" );
 16+ *
 17+ * This extension is based on:
 18+ * https://www.mediawiki.org/wiki/Manual:Suhosin_(Hardened-PHP_Project_patch_and_extension)
 19+ *
 20+ * @author Thomas Gries
 21+ * @license GPL v2
 22+ * @license MIT
 23+ *
 24+ * Dual licensed under the MIT and GPL licenses:
 25+ * http://www.opensource.org/licenses/mit-license.php
 26+ * http://www.gnu.org/licenses/gpl.html
 27+ *
 28+ */
 29+
 30+# Check environment
 31+if ( !defined( 'MEDIAWIKI' ) ) {
 32+ echo( "This is an extension to MediaWiki and cannot be run standalone.\n" );
 33+ die( - 1 );
 34+}
 35+
 36+# Credits
 37+$wgExtensionCredits['parserhook'][] = array(
 38+ 'path' => __FILE__,
 39+ 'name' => 'Suhosin',
 40+ 'author' => array( 'Thomas Gries' ),
 41+ 'version' => '1.08 20120215',
 42+ 'url' => 'https://www.mediawiki.org/wiki/Extension:Suhosin',
 43+ 'descriptionmsg' => 'suhosin-desc',
 44+);
 45+
 46+$dir = dirname( __FILE__ ) . '/';
 47+$wgExtensionMessagesFiles['Suhosin'] = $dir . 'Suhosin.i18n.php';
 48+
 49+# Query string length limit for ResourceLoader. You should only set this if
 50+# your web server has a query string length limit (then set it to that limit),
 51+# or if you have suhosin.get.max_value_length set in php.ini (then set it to
 52+# that value)
 53+# Default in DefaultSettings.php:
 54+# $wgResourceLoaderMaxQueryLength = -1;
 55+
 56+if ( extension_loaded( "suhosin" )
 57+ && ini_get( "suhosin.get.max_name_length" )
 58+ && isset( $wgResourceLoaderMaxQueryLength )
 59+ && $wgResourceLoaderMaxQueryLength > 0 ) {
 60+
 61+ // suhosin is active, thus do something meaningful with ini_get( "suhosin.get.max_name_length" )
 62+ $wgResourceLoaderMaxQueryLength = min( $wgResourceLoaderMaxQueryLength, ini_get( "suhosin.get.max_name_length" ) );
 63+}
Property changes on: trunk/extensions/Suhosin/Suhosin.php
___________________________________________________________________
Added: svn:mime-type
164 + text/x-php
Added: svn:keywords
265 + Author Date Id Rev URL
Added: svn:eol-style
366 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r111755r111702: Consistency tweaks in preparation for adding extension to translatew...raymond15:15, 17 February 2012
r111756r111702: Register extension for translatewiki.net.raymond15:15, 17 February 2012

Comments

#Comment by Nikerabbit (talk | contribs)   07:23, 17 February 2012

I don't think we use text/x-php mime-type for php files.

#Comment by Wikinaut (talk | contribs)   07:57, 17 February 2012

my svn has added that by default through its .subversion [autoprops]

  • .php = svn:eol-style=native; svn:keywords="Author Date Id Rev URL"; svn:mime-type=text/x-php

I will obey to set up my local auto-props as described in https://www.mediawiki.org/wiki/Subversion/auto-props . Until now I changed only a few settings.

Status & tagging log