Author Topic: PreCheck::sanitizeFilename diacritics  (Read 635 times)

Offline KEnik

  • Posts: 27
PreCheck::sanitizeFilename diacritics
« 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?


Offline dbs

  • Betatester
  • **
  • Posts: 8803
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: PreCheck::sanitizeFilename diacritics
« Reply #1 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.

 

postern-length