Commit 236f1ce9 authored by mondrake's avatar mondrake Committed by mondrake
Browse files

Issue #3180540 by mondrake: Sophron guesser module failing on D9.1

parent 65ea9baf
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ class SophronMimeTypeGuesser implements MimeTypeGuesserInterface {
  /**
   * {@inheritdoc}
   */
  public function guess($path) {
  public function guessMimeType(string $path) : ?string {
    $extension = '';
    $file_parts = explode('.', $this->fileSystem->basename($path));

@@ -61,6 +61,21 @@ class SophronMimeTypeGuesser implements MimeTypeGuesserInterface {
    return 'application/octet-stream';
  }

  /**
   * {@inheritdoc}
   */
  public function guess($path) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::guessMimeType() instead. See https://www.drupal.org/node/3133341', E_USER_DEPRECATED);
    return $this->guessMimeType($path);
  }

  /**
   * {@inheritdoc}
   */
  public function isGuesserSupported(): bool {
    return TRUE;
  }

  /**
   * Sets the mimetypes/extension mapping to use when guessing mimetype.
   *