Beispiel #1
2
 public function goBack()
 {
     if ($this->request->hasHeader('HTTP_REFERER')) {
         $referer = $this->request->getHeader('HTTP_REFERER')[0];
         return $this->response->withRedirect($referer, 301);
     }
     return $this->goHome();
 }
Beispiel #2
0
 /**
  * Checks if request headers are partial upload headers
  *
  * @param Request $slRequest Slim request object
  *
  * @return boolean
  */
 public static function checkPartialUpload(\Slim\Http\Request $slRequest)
 {
     if ($slRequest->hasHeader('Content-Type') === true) {
         $contentType = $slRequest->getHeader('Content-Type');
         if (stripos($contentType[0], static::HEADERMULTI) !== false) {
             $posBoundary = stripos($contentType[0], static::BOUNDARYSPLIT);
             $posBoundary = $posBoundary + strlen(static::BOUNDARYSPLIT);
             return static::FIXEDBOUNDARY . substr($contentType[0], $posBoundary);
         }
     }
     return false;
 }