Although one can just post the twitter post ID and it works I thought I would just submit a fix for the scenario where the tweet URL has been added in the dialogue.

To reproduce:

  1. Click on "Create a new twitter atom" button
  2. Paste a full tweet URL into the "twitter identifier or URL" field
  3. Click continue
  4. you get an error "Invalid twitter ID or URL." even if it is a valid tweet URL

Comments

duncan.moo created an issue. See original summary.

duncan.moo’s picture

Status: Active » Needs review
StatusFileSize
new1.91 KB

I have made the following changes in the attached patch:

  1. Updated the regex expression SCALD_TWITTER_WEB_REGEXP
  2. Used the matched output of the regex to get the ID from the URL
  3. Removed the function scald_twitter_resolve_url as it was only called on line 324 and was double validating what scald_twitter_text does on line 340
duncan.moo’s picture

Assigned: duncan.moo » Unassigned
jcisio’s picture

Status: Needs review » Fixed

Patch looks good. Thanks!

  • jcisio committed 29e96d7 on 7.x-1.x authored by duncan.moo
    Issue #2632492 by duncan.moo: Tweet URL not validating when creating...

  • jcisio committed d357c0a on 7.x-1.x
    Revert "Issue #2632492 by duncan.moo: Tweet URL not validating when...
jcisio’s picture

Status: Fixed » Needs review

Sorry, I wrongly committed another patch.

jcisio’s picture

Status: Needs review » Postponed (maintainer needs more info)

I don't see any change in the regex, except that "#" is used as delimiter instead of "/". And scald_twitter_resolve_url check for the existence of the tweet, so it is different validation, "works as designed".

  • jcisio committed ad6adf7 on 7.x-1.x authored by duncan.moo
    Issue #2632492 by duncan.moo, jcisio: Tweet URL not validating when...
jcisio’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thank you. I checked again and it turns out that Twitter has disabled direct access to the tweet for anonymous user, so that check no longer works. Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.