[Notice] Undefined index: HTTP_REFERER

GET /corporate/downloads/getfile/environmental-and-sustainability-policy

Line 245 in /usr/www/users/cilmuf/devmac-core/src/Pages/DownloadPage.php

Source

236             }
237             return $r;
238         }
239         return $files;
240     }
241     
242     public function getfile(){
243         // determine if the link is external
244         $isExternal = true ;
245         if(Director::protocolAndHost() == substr($_SERVER['HTTP_REFERER'],0,strlen(Director::protocolAndHost()))){
246             $isExternal = false ;
247         }
248         // redirect the user to the download page if they can't download externally
249         if($isExternal && !$this->AllowExternal){
250             return $this->redirect($this->Link().'?external=1');
251         }

Trace

Redirecting to https://www.cil-uk.co.uk/corporate/downloads/?external=1... (output started on /usr/www/users/cilmuf/vendor/silverstripe/framework/src/Control/HTTPResponse.php, line 419)