Skip to content

Instantly share code, notes, and snippets.

View ciencia's full-sized avatar

Jesús Martínez Novo ciencia

View GitHub Profile
@ciencia
ciencia / LocalSettings.php
Last active February 26, 2022 11:53
Grabbers
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost:/mnt/tmpgrab/mysql/mysql.sock";
$wgDBname = "grabber";
$wgDBuser = "grabber";
$wgDBpassword = "grabber";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
@ciencia
ciencia / CookieWarning_noreflow.patch
Created March 26, 2021 17:43
patch Extension:CookieWarning no reflow
--- resources/ext.CookieWarning/ext.CookieWarning.mobile.less 2021-01-31 17:56:11.917323461 +0100
+++ resources/ext.CookieWarning/ext.CookieWarning.mobile.less 2021-01-31 18:31:15.801560790 +0100
@@ -10,6 +10,13 @@
font-weight: 500;
font-style: normal;
font-stretch: normal;
+ /* WikiDex: Hacer que quede pegado abajo para evitar reflow */
+ position: fixed;
+ bottom: 0;
+ z-index: 999;
@ciencia
ciencia / General_Suggestions_delay.patch
Created March 26, 2021 17:47
patch MediaWiki core General suggestions delay
diff --git a/resources/src/mediawiki.searchSuggest/searchSuggest.js b/resources/src/mediawiki.searchSuggest/searchSuggest.js
index c5357305d5..42ad14a744 100644
--- a/resources/src/mediawiki.searchSuggest/searchSuggest.js
+++ b/resources/src/mediawiki.searchSuggest/searchSuggest.js
@@ -318,7 +318,8 @@
after: onAfterUpdate
},
cache: true,
- highlightInput: true
+ highlightInput: true,
@ciencia
ciencia / Gerrit-612939-SpecialStatistics_SummaryText.patch
Created March 26, 2021 18:03
patch MediaWiki core enable Special:Statistics description
From c695c9e6374e64321d96d150e6ab8a93a55b1360 Mon Sep 17 00:00:00 2001
From: Ammar Abdulhamid
Date: Wed, 15 Jul 2020 20:56:45 +0100
Subject: [PATCH] Allow description text for uploaded files line in Special:Statistics
Also make Statistics summary text to really work. The message
exists for a long time but it is not being used in the special page.
Bug: T258095
Change-Id: Ic228fdb7b13ef824ef0611d9cb2d5b79504cd929
@ciencia
ciencia / core-T272386-move-inadvertent-deletion.diff
Created April 9, 2021 17:38
patch MediaWiki core T272386 MW1.34
diff --git a/includes/MovePage.php b/includes/MovePage.php
index a5d0af4..7c4c3d4 100644
--- a/includes/MovePage.php
+++ b/includes/MovePage.php
@@ -216,7 +216,9 @@
if ( $this->oldTitle->equals( $this->newTitle ) ) {
$status->fatal( 'selfmove' );
- } elseif ( $this->newTitle->getArticleID() && !$this->isValidMoveTarget() ) {
+ } elseif ( $this->newTitle->getArticleID( Title::READ_LATEST /* T272386 */ )
@ciencia
ciencia / SyntaxHighlight-T276843-Vulnerable-lexers.diff
Created April 9, 2021 17:40
patch MediaWiki 1.34 extension SyntaxHighlight T276843 disable Vulnerable lexers
diff --git a/SyntaxHighlight.lexers.php b/SyntaxHighlight.lexers.php
index f64672e..968dd72 100644
--- a/SyntaxHighlight.lexers.php
+++ b/SyntaxHighlight.lexers.php
@@ -11,7 +11,8 @@
'ada' => true,
'ada2005' => true,
'ada95' => true,
- 'adl' => true,
+ // Disabled because of CVE-2021-27291
@ciencia
ciencia / core-T278014_escape_message.diff
Created April 9, 2021 17:42
patch MediaWiki core 1.34 T278014 escape message
diff --git a/includes/specials/SpecialNewFiles.php b/includes/specials/SpecialNewFiles.php
index 2c49e5f..d32313b 100644
--- a/includes/specials/SpecialNewFiles.php
+++ b/includes/specials/SpecialNewFiles.php
@@ -118,7 +118,7 @@
// mediastatistics-header-office, mediastatistics-header-text,
// mediastatistics-header-executable, mediastatistics-header-archive,
// mediastatistics-header-3d,
- return $this->msg( 'mediastatistics-header-' . strtolower( $type ) )->text();
+ return $this->msg( 'mediastatistics-header-' . strtolower( $type ) )->escaped();
@ciencia
ciencia / core-T278058_escape_message.diff
Created April 9, 2021 17:43
patch MediaWiki core 1.34 T278058 escape message
diff --git a/resources/src/mediawiki.rcfilters/ui/TagItemWidget.js b/resources/src/mediawiki.rcfilters/ui/TagItemWidget.js
index 5d45d18..ba7b920 100644
--- a/resources/src/mediawiki.rcfilters/ui/TagItemWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/TagItemWidget.js
@@ -94,7 +94,7 @@
).contents() );
} else {
this.setLabel(
- $( '<bdi>' ).append(
+ $( '<bdi>' ).text(
@ciencia
ciencia / opcache.php
Created April 16, 2021 15:36
opcache status - Script to get a nice visualization of opcache status (memory available, consumed, dirty...) I don't remember from where I grabbed it, but I haven't coded it
<?php
define('THOUSAND_SEPARATOR',true);
if (!extension_loaded('Zend OPcache')) {
echo '<div style="background-color: #F2DEDE; color: #B94A48; padding: 1em;">You do not have the Zend OPcache extension loaded, sample data is being shown instead.</div>';
require 'data-sample.php';
}
class OpCacheDataModel
@ciencia
ciencia / ext-cookiewarning-displaydelay.diff
Created July 27, 2021 15:28
patch Extension:CookieWarning display delay
--- extensions/CookieWarning/resources/ext.CookieWarning/ext.CookieWarning.less 2021-07-27 13:47:14.732034066 +0000
+++ extensions/CookieWarning/resources/ext.CookieWarning/ext.CookieWarning.less 2021-07-27 15:24:20.621631670 +0000
@@ -9,6 +9,7 @@
z-index: 1999;
display: flex;
justify-content: center;
+ animation: mw-cookiewarning-fadein 3s; // WikiDex: delay display
// Narrow mobile screens
// 550px is a mostly arbitrary number, though it's used by a few other exts and skins