Problem/Motivation

Using shurly I got

Message	Warning: Undefined array key "HTTP_REFERER" in shurly_analytics_shurly_redirect_after() (line 31 of /web/modules/contrib/shurly/shurly_analytics/shurly_analytics.module)

Steps to reproduce

Use Shurly module, anonymous user clicks on short-url, warning kicks in.

Thanks for your reply in advance, greetings,

Comments

Summit created an issue. See original summary.

summit’s picture

Issue summary: View changes
samir_shukla’s picture

Status: Active » Needs review
StatusFileSize
new834 bytes

Hi, I have created the patch for the issue. Please review.

summit’s picture

Status: Needs review » Reviewed & tested by the community

Hi, tested it, thanks!

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

A wonderful opportunity to learn about null-coalescing operators: https://www.php.net/manual/en/migration70.new-features.php#migration70.n...

chandreshgiri gauswami’s picture

Status: Needs work » Needs review
StatusFileSize
new803 bytes
c-logemann’s picture

Status: Needs review » Needs work

Just made a visual check of the #6 patch so I didn't know if this will work:

$dr = $_SERVER['HTTP_REFERER'] ?? : NULL;

The correct form is without ":"

$dr = $_SERVER['HTTP_REFERER'] ?? NULL;
chandreshgiri gauswami’s picture

Assigned: Unassigned » chandreshgiri gauswami

Hi @C-Logemann,

Thanks for pointing this out. I will work and fix this.

chandreshgiri gauswami’s picture

Assigned: chandreshgiri gauswami » Unassigned
Status: Needs work » Needs review
StatusFileSize
new801 bytes

Fixed syntax error and generated new patch.

  • jcnventura committed 06235f1b on 8.x-1.x
    Issue #3409668 by Chandreshgiri Gauswami, samir_shukla, Summit,...
jcnventura’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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