[Notice] Undefined index: HTTP_REFERER

GET /training/training-index/getfile/tripod-set-up-use-and-recovery

Line 242 in /usr/www/users/ppsafn/devmac-core/src/Pages/DownloadPage.php

Source

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

Trace

Redirecting to https://www.ppsafety.co.uk/training/training-index/?external=1... (output started on /usr/www/users/ppsafn/vendor/silverstripe/framework/src/Control/HTTPResponse.php, line 419)