Undefined index: token in flag_page()

Created on 29 July 2015, over 9 years ago
Updated 13 February 2024, 12 months ago

Problem/Motivation

Getting a lot of these in my error logs:

Type	php
Date	Wednesday, July 29, 2015 - 08:10
User	Guest (not verified)
Location	https://example.com/us/flag/flag/wishlist/15843?destination=taxonomy/term/1023&token=d847602157c9ee4af6c1eabfcd1b2d91
Referrer	
Message	Notice: Undefined index: token in flag_page() (line 25 of ./includes/flag.pages.inc).
Severity	notice
Hostname	167.114.156.198

Proposed resolution

Check key exists before using it, my guess is that it's double encoding the & in cache some place which is a different problem or a bot is doing that, either way it works fine as is, just needs a check.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

3.0

Component

Flag core

Created by

🇨🇦Canada joelpittet Vancouver

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 7.x + Environment: PHP 5.6 & MySQL 5.5
    last update 12 months ago
    30 pass
  • 🇦🇹Austria klausi 🇦🇹 Vienna

    I don't think the patch from #13 is the right approach. There can always be malformed requests by bad crawlers, so the page callback needs to be written in a robust way to not throw PHP warnings.

    Patch from #1 is the correct approach IMO.

    Setting this back to RTBC for patch #1, which is a straight forward fix.

Production build 0.71.5 2024