[Notice] Undefined index: HTTP_REFERER

GET /library/x-microwave/getfile/quick-turn-design

Line 245 in /usr/www/users/castlq/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.castlemicrowave.com/library/x-microwave/getfile... (output started on /usr/www/users/castlq/vendor/silverstripe/framework/src/Control/HTTPResponse.php, line 419)