Adjust regex rules to allow adding tweets from x.com domain

Created on 9 October 2023, about 1 year ago
Updated 28 May 2024, 7 months ago

Problem/Motivation

Currently the Twitter media source plugin only accepts tweet from twitter.com domains.

 /**
   * List of validation regular expressions.
   *
   * @var array
   */
  public static $validationRegexp = [
    '@((http|https):){0,1}//(www\.){0,1}twitter\.com/(?<user>[a-z0-9_-]+)/(status(es){0,1})/(?<id>[\d]+)@i' => 'id',
  ];

Steps to reproduce

  1. Open https://twitter.com/Drupal in your browser
  2. Use share button below a state you want to share
  3. Copy link from popup of share button
  4. Investigate copied URL via curl -I command

Proposed resolution

Adjust regex rule to also allow adding tweets from x.com domains.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany IT-Cru Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024