mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-18 09:54:35 +02:00
Fixed typos
This commit is contained in:
parent
63df16a369
commit
d04d743520
144 changed files with 263 additions and 265 deletions
|
@ -57,7 +57,7 @@ class AttachmentURLGenerator
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts the absolute file path to a version relative to the public folder, that can be passed to asset
|
||||
* Converts the absolute file path to a version relative to the public folder, that can be passed to the
|
||||
* Asset Component functions.
|
||||
*
|
||||
* @param string $absolute_path the absolute path that should be converted
|
||||
|
@ -77,7 +77,7 @@ class AttachmentURLGenerator
|
|||
$public_path = $this->public_path;
|
||||
}
|
||||
|
||||
//Our absolute path must begin with public path or we can not use it for asset pathes.
|
||||
//Our absolute path must begin with public path, or we can not use it for asset pathes.
|
||||
if (0 !== strpos($absolute_path, $public_path)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class AttachmentURLGenerator
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts a placeholder path to a path to a image path.
|
||||
* Converts a placeholder path to a path to an image path.
|
||||
*
|
||||
* @param string $placeholder_path the placeholder path that should be converted
|
||||
*/
|
||||
|
@ -120,7 +120,7 @@ class AttachmentURLGenerator
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a URL to an thumbnail of the attachment file.
|
||||
* Returns a URL to a thumbnail of the attachment file.
|
||||
* @return string|null The URL or null if the attachment file is not existing
|
||||
*/
|
||||
public function getThumbnailURL(Attachment $attachment, string $filter_name = 'thumbnail_sm'): ?string
|
||||
|
@ -155,7 +155,7 @@ class AttachmentURLGenerator
|
|||
//So we remove the schema manually
|
||||
return preg_replace('/^https?:/', '', $tmp);
|
||||
} catch (\Imagine\Exception\RuntimeException $e) {
|
||||
//If the filter fails, we can not serve the thumbnail and fall back to the original image and log an warning
|
||||
//If the filter fails, we can not serve the thumbnail and fall back to the original image and log a warning
|
||||
$this->logger->warning('Could not open thumbnail for attachment with ID ' . $attachment->getID() . ': ' . $e->getMessage());
|
||||
return $this->assets->getUrl($asset_path);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue