* $wgXhtmlDefaultNamespace is no longer used by core. Setting it will no longer change the
xmlns used by MediaWiki. Reliance on this variable by extensions is deprecated.
* $wgHandheldStyle was removed.
+* $wgJsMimeType is no longer used by core. Most usage has been removed since
+ HTML output is now exclusively HTML5.
=== New features in 1.22 ===
* (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes.
<html>
<head>
<title>CSS Child selector emulation for IE 6</title>
- <style type="text/css">
+ <style>
/** Common rules **/
body { background-color: #CCC; }
table { border:1px black solid; }
</tr>
</table>
<p><strong>NOTE:</strong>The nested caption keep the green background. The nested table keep the black border. This is because those declarations are global so we did not reset them.</p>
-
<!DOCTYPE html>
-<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
+<html lang="en" dir="ltr">
<head>
- <link rel="stylesheet" href="../../skins/common/shared.css" />
+ <link rel="stylesheet" href="../../skins/common/shared.css">
</head>
<body style="font-size: small;">
<tr><td>line with hover</td><td>line with hover</td></tr>
</table>
-</body></html>
+</body>
+</html>
<!DOCTYPE html>
-<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
+<html lang="en" dir="ltr">
<head>
- <link rel="stylesheet" href="../../resources/mediawiki.action/mediawiki.action.history.diff.css" />
+ <link rel="stylesheet" href="../../resources/mediawiki.action/mediawiki.action.history.diff.css">
</head>
<body style="background-color: #C0C0C0;">
<p>
</td></tr>
</table>
-</body></html>
+</body>
+</html>
<!DOCTYPE html>
-<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
+<html lang="en" dir="ltr">
<head>
- <style type="text/css">
+ <style>
pre {
border: 1px dashed #AAA;
background-color: #E0E0E0;
font-family: monospace, DOESNOTEXISTREALLY;'>
font-family: monospace, DOESNOTEXISTREALLY;
</pre>
-
<!DOCTYPE html>
<html>
<head>
- <style type="text/css">
+ <style>
/** This is just for coloring: */
table { border: 1px solid #CC0; }
td { border: 1px solid #CCC; }
</tr>
</table>
</div>
-
'HTMLFloatField' => 'includes/HTMLForm.php',
'HTMLForm' => 'includes/HTMLForm.php',
'HTMLFormField' => 'includes/HTMLForm.php',
+ 'HTMLFormFieldRequiredOptionsException' => 'includes/HTMLForm.php',
'HTMLHiddenField' => 'includes/HTMLForm.php',
'HTMLInfoField' => 'includes/HTMLForm.php',
'HTMLIntField' => 'includes/HTMLForm.php',
+ 'HTMLNestedFilterable' => 'includes/HTMLForm.php',
'HTMLMultiSelectField' => 'includes/HTMLForm.php',
'HTMLRadioField' => 'includes/HTMLForm.php',
'HTMLSelectAndOtherField' => 'includes/HTMLForm.php',
$wgMimeType = 'text/html';
/**
- * The content type used in script tags. This is mostly going to be ignored at
- * least for actual HTML output, since HTML5 doesn't require a MIME type for
- * JavaScript or CSS (those are the default script and style languages).
+ * Previously used as content type in HTML script tags. This is now ignored since
+ * HTML5 doesn't require a MIME type for script tags (javascript is the default).
+ * It was also previously used by RawAction to determine the ctype query parameter
+ * value that will result in a javascript response.
+ * @deprecated since 1.22
*/
-$wgJsMimeType = 'text/javascript';
+$wgJsMimeType = null;
/**
* The default xmlns attribute. The option to define this has been removed.
$wgActions[$action] = false;
}
-# We always output html5 since 1.22, override any change made by local settings
+# We always output HTML5 since 1.22, overriding these is no longer supported
+# we set them here for extensions that depend on its value.
$wgHtml5 = true;
-
-# Setting wgXhtmlDefaultNamespace is not supported since 1.22.
-# However we define it here for extensions that depend on its value.
$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
+$wgJsMimeType = 'text/javascript';
if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
# see http://www.w3.org/TR/rdfa-in-html/#document-conformance
* @ingroup SpecialPage
*/
class SpecialPage {
-
// The canonical name of this special page
// Also used for the default <h1> heading, @see getDescription()
protected $mName;
* If you override execute(), you can recover the default behavior with userCanExecute()
* and displayRestrictionError()
*
- * @param string $name name of the special page, as seen in links and URLs
- * @param string $restriction user right required, e.g. "block" or "delete"
- * @param bool $listed whether the page is listed in Special:Specialpages
- * @param $function Callback|Bool: function called by execute(). By default it is constructed from $name
- * @param string $file file which is included by execute(). It is also constructed from $name by default
- * @param bool $includable whether the page can be included in normal pages
+ * @param string $name Name of the special page, as seen in links and URLs
+ * @param string $restriction User right required, e.g. "block" or "delete"
+ * @param bool $listed Whether the page is listed in Special:Specialpages
+ * @param Callback|Bool $function Function called by execute(). By default
+ * it is constructed from $name
+ * @param string $file File which is included by execute(). It is also
+ * constructed from $name by default
+ * @param bool $includable Whether the page can be included in normal pages
*/
public function __construct(
$name = '', $restriction = '', $listed = true,
/**
* Do the real work for the constructor, mainly so __call() can intercept
* calls to SpecialPage()
- * @param string $name name of the special page, as seen in links and URLs
- * @param string $restriction user right required, e.g. "block" or "delete"
- * @param bool $listed whether the page is listed in Special:Specialpages
- * @param $function Callback|Bool: function called by execute(). By default it is constructed from $name
- * @param string $file file which is included by execute(). It is also constructed from $name by default
- * @param bool $includable whether the page can be included in normal pages
+ * @param string $name Name of the special page, as seen in links and URLs
+ * @param string $restriction User right required, e.g. "block" or "delete"
+ * @param bool $listed Whether the page is listed in Special:Specialpages
+ * @param Callback|Bool $function Function called by execute(). By default
+ * it is constructed from $name
+ * @param string $file File which is included by execute(). It is also
+ * constructed from $name by default
+ * @param bool $includable Whether the page can be included in normal pages
*/
private function init( $name, $restriction, $listed, $function, $file, $includable ) {
$this->mName = $name;
if ( $this->mContext instanceof IContextSource ) {
return $this->mContext;
} else {
- wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
+ wfDebug( __METHOD__ . " called and \$mContext is null. " .
+ "Return RequestContext::getMain(); for sanity\n" );
return RequestContext::getMain();
}
}
* Play with the HTMLForm if you need to more substantially
* @param $form HTMLForm
*/
- protected function alterForm( HTMLForm $form ) {}
+ protected function alterForm( HTMLForm $form ) {
+ }
/**
* Get message prefix for HTMLForm
* confirmation message
* @since 1.22 Default is to do nothing
*/
- public function onSuccess() {}
+ public function onSuccess() {
+ }
/**
* Basic SpecialPage workflow: get a form, send it to the user; get some data back,
}
abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
+ // @todo FIXME: Visibility must be declared
var $redirName, $redirSubpage;
function __construct(
* - limit, offset: Useful for linking to history of one's own user page or
* user talk page. For example, this would be a link to "the last edit to your
* user talk page in the year 2010":
- * http://en.wikipedia.org/w/index.php?title=Special:MyPage&offset=20110000000000&limit=1&action=history
+ * http://en.wikipedia.org/wiki/Special:MyPage?offset=20110000000000&limit=1&action=history
*
* - feed: would allow linking to the current user's RSS feed for their user
* talk page:
}
function onView() {
- global $wgSquidMaxage, $wgForcedRawSMaxage, $wgJsMimeType;
+ global $wgSquidMaxage, $wgForcedRawSMaxage;
$this->getOutput()->disable();
$request = $this->getRequest();
# Force caching for CSS and JS raw content, default: 5 minutes
if ( $smaxage === null ) {
- if ( $contentType == 'text/css' || $contentType == $wgJsMimeType ) {
+ if ( $contentType == 'text/css' || $contentType == 'text/javascript' ) {
$smaxage = intval( $wgForcedRawSMaxage );
} else {
$smaxage = 0;
* @return String
*/
public function getContentType() {
- global $wgJsMimeType;
-
$ctype = $this->getRequest()->getVal( 'ctype' );
if ( $ctype == '' ) {
$gen = $this->getRequest()->getVal( 'gen' );
if ( $gen == 'js' ) {
- $ctype = $wgJsMimeType;
+ $ctype = 'text/javascript';
} elseif ( $gen == 'css' ) {
$ctype = 'text/css';
}
}
- $allowedCTypes = array( 'text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit' );
+ $allowedCTypes = array( 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' );
if ( $ctype == '' || !in_array( $ctype, $allowedCTypes ) ) {
$ctype = 'text/x-wiki';
}
'  ' .
htmlspecialchars( $this->getVar( 'wgRightsText' ) ) .
"</p>\n" .
- "<p style=\"text-align: center\">" .
+ "<p style=\"text-align: center;\">" .
Html::element( 'a',
array(
'href' => $this->getCCPartnerUrl(),
wfMessage( 'config-cc-again' )->text()
) .
"</p>\n" .
- "<script type=\"text/javascript\">\n" .
+ "<script>\n" .
# Reduce the wrapper div height
htmlspecialchars( $reduceJs ) .
"\n" .
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) &&
strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) {
// JS appears the only method that works consistently with IE7+
- $this->addHtml( "\n<script type=\"" . $GLOBALS['wgJsMimeType'] .
- '">jQuery( document ).ready( function() { document.location=' .
+ $this->addHtml( "\n<script>jQuery( document ).ready( function () { document.location = " .
Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
} else {
$this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" );
There's an experimental PHP extension module which wraps the ICU library's
normalization functions. This is *MUCH* faster than doing this work in pure
-PHP code. This is in the 'normal' directory in MediaWiki's CVS extensions
-module. It is known to work with PHP 4.3.8 and 5.0.2 on Linux/x86 but hasn't
+PHP code. This is at https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/normal.git;a=summary.
+It is known to work with PHP 4.3.8 and 5.0.2 on Linux/x86 but hasn't
been thoroughly tested on other configurations.
If the php_normal.so module is loaded in php.ini, the normalization functions
// Save filtered text to Memcached
$cache->set( $key, $result );
} catch ( Exception $exception ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": minification failed: $e" );
+ $this->hasErrors = true;
// Return exception as a comment
$result = $this->makeComment( $exception->__toString() );
- $this->hasErrors = true;
}
wfProfileOut( __METHOD__ );
// Do not allow private modules to be loaded from the web.
// This is a security issue, see bug 34907.
if ( $module->getGroup() === 'private' ) {
- $errors .= $this->makeComment( "Cannot show private module \"$name\"" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ": request for private module denied: $e" );
$this->hasErrors = true;
+ // Add exception to the output as a comment
+ $errors .= $this->makeComment( "Cannot show private module \"$name\"" );
+
continue;
}
$modules[$name] = $module;
try {
$this->preloadModuleInfo( array_keys( $modules ), $context );
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": preloading module info failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$errors .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
}
wfProfileIn( __METHOD__ . '-getModifiedTime' );
// Calculate maximum modified time
$mtime = max( $mtime, $module->getModifiedTime( $context ) );
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": calculating maximum modified time failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$errors .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
}
}
try {
$blobs = MessageBlobStore::get( $this, $modules, $context->getLanguage() );
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": pre-fetching blobs from MessageBlobStore failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$exceptions .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
}
} else {
$blobs = array();
break;
}
} catch ( Exception $e ) {
+ wfDebugLog( 'resourceloader', __METHOD__ . ": generating module package failed: $e" );
+ $this->hasErrors = true;
// Add exception to the output as a comment
$exceptions .= $this->makeComment( $e->__toString() );
- $this->hasErrors = true;
// Register module as missing
$missing[] = $name;
);
}
} catch ( Exception $e ) {
- wfDebug( __METHOD__ . " failed to update DB: $e\n" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ": failed to update DB: $e" );
}
return $styles;
}
$content = $revision->getContent( Revision::RAW );
if ( !$content ) {
- wfDebug( __METHOD__ . "failed to load content of JS/CSS page!\n" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ': failed to load content of JS/CSS page!' );
return null;
}
$model = $content->getModel();
if ( $model !== CONTENT_MODEL_CSS && $model !== CONTENT_MODEL_JAVASCRIPT ) {
- wfDebug( __METHOD__ . "bad content model $model for JS/CSS page!\n" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ': bad content model $model for JS/CSS page!' );
return null;
}
// this one is needed when the text is inside an HTML markup
$htmlfix = '|<[^>]+$|^[^<>]*>';
- // disable convert to variants between <code></code> tags
+ // disable convert to variants between <code> tags
$codefix = '<code>.+?<\/code>|';
- // disable convertsion of <script type="text/javascript"> ... </script>
+ // disable conversion of <script> tags
$scriptfix = '<script.*?>.*?<\/script>|';
- // disable conversion of <pre xxxx> ... </pre>
+ // disable conversion of <pre> tags
$prefix = '<pre.*?>.*?<\/pre>|';
$reg = '/' . $codefix . $scriptfix . $prefix .
'Kategoria_diskuto' => NS_CATEGORY_TALK,
);
+$namespaceGenderAliases = array(
+ NS_USER => array( 'male' => 'Uzanto', 'female' => 'Uzantino' ),
+ NS_USER_TALK => array( 'male' => 'Uzanto-Diskuto', 'female' => 'Uzantino-Diskuto' ),
+);
+
$specialPageAliases = array(
'Activeusers' => array( 'Aktivaj_uzantoj' ),
'Allmessages' => array( 'Ĉiuj_mesaĝoj' ),
* @ingroup Maintenance
*/
-
require_once( __DIR__ . '/Maintenance.php' );
/**
public function __construct() {
parent::__construct();
$this->mDescription = "Verify that database usernames are actually valid";
+ $this->setBatchSize( 1000 );
}
function execute() {
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select( 'user',
- array( 'user_id', 'user_name' ),
- null,
- __METHOD__
- );
+ $maxUserId = 0;
+ do {
+ $res = $dbr->select( 'user',
+ array( 'user_id', 'user_name' ),
+ array( 'user_id > ' . $maxUserId ),
+ __METHOD__,
+ array(
+ 'ORDER BY' => 'user_id',
+ 'LIMIT' => $this->mBatchSize,
+ )
+ );
- foreach ( $res as $row ) {
- if ( ! User::isValidUserName( $row->user_name ) ) {
- $this->error( sprintf( "%s: %6d: '%s'\n", wfWikiID(), $row->user_id, $row->user_name ) );
- wfDebugLog( 'checkUsernames', $row->user_name );
+ foreach ( $res as $row ) {
+ if ( ! User::isValidUserName( $row->user_name ) ) {
+ $this->error( sprintf( "%s: %6d: '%s'\n", wfWikiID(), $row->user_id, $row->user_name ) );
+ wfDebugLog( 'checkUsernames', $row->user_name );
+ }
}
- }
+ $maxUserId = $row->user_id;
+ } while( $res->numRows() );
}
}
* Ported from skins/common/edit.js by Trevor Parscal
* (c) 2009 Wikimedia Foundation (GPLv2) - http://www.wikimedia.org
*
- * Inserts text at the begining and end of a text selection, optionally
+ * Inserts text at the beginning and end of a text selection, optionally
* inserting text at the caret when selection is empty.
*
* @fixme document the options parameters
* Some code copied from
* http://www.dedestruct.com/2008/03/22/howto-cross-browser-cursor-position-in-textareas/
*
- * Get the position (in resolution of bytes not nessecarily characters)
+ * Get the position (in resolution of bytes not necessarily characters)
* in a textarea
*
* Will focus the textarea in some browsers (IE/Opera)
* Returns null if not found.
*
* @param {string} param The parameter name.
- * @param {string} [url] URL to search through.
+ * @param {string} [url=document.location.href] URL to search through, defaulting to the current document's URL.
* @return {Mixed} Parameter value or null.
*/
getParamValue: function ( param, url ) {
'ParserTestResult' => "$testDir/parser/ParserTestResult.php",
'TestFileIterator' => "$testDir/testHelpers.inc",
'TestRecorder' => "$testDir/testHelpers.inc",
+ 'ITestRecorder' => "$testDir/testHelpers.inc",
# tests/phpunit
'MediaWikiTestCase' => "$testDir/phpunit/MediaWikiTestCase.php",
//db
'ORMTableTest' => "$testDir/phpunit/includes/db/ORMTableTest.php",
+ 'PageORMTableForTesting' => "$testDir/phpunit/includes/db/ORMTableTest.php",
'DatabaseTestHelper' => "$testDir/phpunit/includes/db/DatabaseTestHelper.php",
# tests/phpunit/includes/api
class SeleniumTestHTMLLogger {
public function setHeaders() {
global $wgOut;
- $wgOut->addHeadItem( 'selenium', '<style type="text/css">
+ $wgOut->addHeadItem( 'selenium', '<style>
.selenium pre {
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
white-space: pre-wrap; /* css-3 */