mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Improve collection title for collections with diacritics
This commit is contained in:
parent
f8c21adaff
commit
75bfec619e
1 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,12 @@ try{
|
||||||
elseif($collection !== null){
|
elseif($collection !== null){
|
||||||
$collection = strtolower(str_replace('-', ' ', Formatter::RemoveDiacritics($collection)));
|
$collection = strtolower(str_replace('-', ' ', Formatter::RemoveDiacritics($collection)));
|
||||||
$ebooks = Library::GetEbooksByCollection($collection);
|
$ebooks = Library::GetEbooksByCollection($collection);
|
||||||
|
// Get the *actual* name of the collection, in case there are accent marks (like "Arsène Lupin")
|
||||||
|
foreach($ebooks[0]->Collections as $c){
|
||||||
|
if($collection == strtolower(str_replace('-', ' ', Formatter::RemoveDiacritics($c->Name)))){
|
||||||
|
$collection = (string)$c->Name; // Explicit typecast to string to satisfy PHPStan
|
||||||
|
}
|
||||||
|
}
|
||||||
$collectionName = ucwords(preg_replace('/^The /ius', '', $collection) ?? '');
|
$collectionName = ucwords(preg_replace('/^The /ius', '', $collection) ?? '');
|
||||||
$pageTitle = 'Browse ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection';
|
$pageTitle = 'Browse ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection';
|
||||||
$pageDescription = 'A list of ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection';
|
$pageDescription = 'A list of ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue