WebsiteBaker Community Forum

WebsiteBaker Support (2.13.x) => General Help & Support => Topic started by: KEnik on August 09, 2022, 09:27:35 PM

Title: PreCheck::sanitizeFilename diacritics
Post by: KEnik on August 09, 2022, 09:27:35 PM
Hi,
PreCheck::sanitizeFilename
Create wrong "link"s
From : Hvězdárna dětem opět od září v programu
       
Good old/pages/posts/hvezdne-leto-na-moninci-opet-s-hvezdarnou-zebrak-1481.php
Wrong New /pages/posts/Hv-zdne-leto-na-Mon-nci-op-t-s-Hv-zd-rnou-ebr-k-1481.php

       

modules/news/savePost.php:211
Code: [Select]
// Work-out what the link should be
    $newLink     = '/posts/'.PreCheck::sanitizeFilename($title).$oReg->PageSpacer.$iPostId;

Temporary fixed by old function ( maybe do not work well in all situation!):
Code: [Select]
public static function sanitizeFilename($val,$caseSensitive = false,$mPageStyle=null)
    {
        return page_filename($val);
}

Can I do pull request If I fix this by editing new function?

Title: Re: PreCheck::sanitizeFilename diacritics
Post by: dbs on August 09, 2022, 10:42:34 PM
The "wrong new" looks very bad. There is a fix needed i think.
You can also use in savePost.php the line 38 instead of 39. Is the same solution like yours.