code: protected function fixPath($path)
      {
          if (substr($path, 0, 1) != '/') {
              $path = '/' . $path;
          }
          if (substr($path, -1, 1) != '/') {
              $path .= '/';
          }
  
          return $path;
      }
docs: Adds a trailing and leading slash to the path if missing.
  
  @param string $path Path to fix.