Skip to content

Instantly share code, notes, and snippets.

@stefanruijsenaars
stefanruijsenaars / ff.py
Last active January 3, 2023 03:20 — forked from elaineo/ff.py
Follow Friday
# -*- coding: utf-8 -*-
import json
import time
import logging
from collections import Counter
from TwitterAPI import TwitterAPI
# Forked from: https://gist.github.com/elaineo/b9d73ce88ac418d4fed8128231bc15e7
# Go to https://apps.twitter.com/ to get your v2 API keys.
diff --git a/modules/node/node.test b/modules/node/node.test
index c7c4711..cb56e85 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -2986,3 +2986,52 @@ class NodePageCacheTest extends NodeWebTestCase {
$this->assertResponse(404);
}
}
+
+/**
diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc
index a96b053..4e59d77 100644
--- a/includes/database/mysql/database.inc
+++ b/includes/database/mysql/database.inc
@@ -28,6 +28,9 @@ class DatabaseConnection_mysql extends DatabaseConnection {
$this->connectionOptions = $connection_options;
+ // Allow the charset to be overridden to utf8mb4 in settings.php.
+ $charset = $this->utf8mb4IsEnabled() && !(isset($this->connectionOptions['_dsn_utf8_fallback']) && $this->connectionOptions['_dsn_utf8_fallback'] === TRUE) ? 'utf8mb4' : 'utf8';
diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc
index a96b053..43fa3d5 100644
--- a/includes/database/mysql/database.inc
+++ b/includes/database/mysql/database.inc
@@ -26,6 +26,8 @@ class DatabaseConnection_mysql extends DatabaseConnection {
// MySQL never supports transactional DDL.
$this->transactionalDDLSupport = FALSE;
+ // Allow the default charset to be overridden in settings.php.
+ $charset = (isset($connection_options['charset']) && $connection_options['charset'] === 'utf8mb4') ? 'utf8mb4' : 'utf8');
diff -u b/core/modules/comment/src/CommentFieldItemList.php b/core/modules/comment/src/CommentFieldItemList.php
--- b/core/modules/comment/src/CommentFieldItemList.php
+++ b/core/modules/comment/src/CommentFieldItemList.php
@@ -51,8 +51,11 @@
}
if ($operation === 'view') {
// Only users with either post comments or access comments permisison can
- // view the field value. The formatter takes care of showing the comment
- // thread and form based on the individual permissions.
+ // view the field value. The formatter,
<area>
<audio>
<base>
<basefont>
<button>
<canvas>
<center>
<datalist>
<dir>
<fieldset>
<applet>
<body>
<embed>
<frame>
<script>
<frameset>
<html>
<input>
<iframe>
sr@MacBook-Pro-de-sr /A/M/h/d/core> ../vendor/phpunit/phpunit/phpunit --filter=CommentStatusFieldAccessTest --verbose
PHPUnit 4.8.11 by Sebastian Bergmann and contributors.
Runtime: PHP 5.6.10
Configuration: /Applications/MAMP/htdocs/drupal/core/phpunit.xml.dist
E
Time: 15.81 seconds, Memory: 199.25Mb
With patch:
[pid 8125] execve("/bin/sh", ["sh", "-c", "/usr/sbin/sendmail -t -i -f'test\\#\\$%\\&\\*\\?\\^\\`\\{\\|\\}\\~@example.com'"], [/* 23 vars */] <unfinished ...>
[pid 8126] execve("/usr/sbin/sendmail", ["/usr/sbin/sendmail", "-t", "-i", "-ftest\\#\\$%\\&\\*\\?\\^\\`\\{\\|\\}\\~@example.com"], [/* 23 vars */]) = 0
Without patch:
[pid 8093] execve("/bin/sh", ["sh", "-c", "/usr/sbin/sendmail -t -i -ftest\\#\\$%\\&\\*\\?\\^\\`\\{\\|\\}\\~@example.com"], [/* 23 vars */] <unfinished ...>
[pid 8094] execve("/usr/sbin/sendmail", ["/usr/sbin/sendmail", "-t", "-i", "-ftest#$%&*?^`{|}~@example.com"], [/* 23 vars */]) = 0

Keybase proof

I hereby claim:

  • I am stefanruijsenaars on github.
  • I am stefan_r (https://keybase.io/stefan_r) on keybase.
  • I have a public key whose fingerprint is 64D3 D557 1BF5 9A74 3DE9 29C4 F54F 0D7F 82C6 7447

To claim this, I am signing this object: