fixSlashes() static public method

Fixes slashes in path
static public fixSlashes ( $str, boolean | false $removeInitial = false, boolean | false $removeTrailing = false ) : mixed | string
$str
$removeInitial boolean | false
$removeTrailing boolean | false
return mixed | string
 /**
  * ---- AWS -----------------------------------------------------------------------------------------------------------
  */
 public function uploadToAWS($filePath)
 {
     if (is_null($this->s3)) {
         $this->s3 = new \S3($this->getSetting('awsAccessKey'), $this->getSetting('awsSecretAccessKey'));
         $this->s3->setExceptions(true);
     }
     $file = $this->s3->inputFile($filePath);
     $headers = $this->getSetting('awsRequestHeaders');
     if (!isset($headers['Cache-Control'])) {
         $headers['Cache-Control'] = 'max-age=' . $this->getSetting('awsCacheDuration') . ', must-revalidate';
     }
     if (!$this->s3->putObject($file, $this->getSetting('awsBucket'), ImagerService::fixSlashes($this->getSetting('awsFolder') . '/' . str_replace($this->getSetting('imagerSystemPath'), '', $filePath), true, true), \S3::ACL_PUBLIC_READ, array(), $headers, $this->_getAWSStorageClass())) {
         ImagerPlugin::log("Upload to AWS failed for {$filePath} in ImagerService", LogLevel::Error);
     }
 }