Custom replacement for title injection

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

Re: Custom replacement for title injection

Postby Bembis » Sun Sep 06, 2009 7:43 am

any body help me
Bembis
 
Posts: 13
Joined: Sun May 25, 2008 9:37 am

Advertisement

Re: Custom replacement for title injection

Postby dcz » Sun Sep 06, 2009 1:11 pm

It's kind of normal, you did not copy all the replacement array. The code to copy past is longer than that, don't you see the scrolling bar on the right of the code block ?

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Bulgarian replacement for title injection

Postby TonyZ » Wed Mar 17, 2010 1:09 pm

This is for Bulgarian (Cyrillic) language.
Almost the same as dcz but included a small corrections: :)
Code: Select all
         $this->url_replace = array(
            'А' => 'A', 'а' => 'a',
            'Б' => 'B', 'б' => 'b',
            'В' => 'V', 'в' => 'v',
            'Г' => 'G', 'г' => 'g',
            'Д' => 'D', 'д' => 'd',
            'Е' => 'E', 'е' => 'e',
            'Ж' => 'Zh', 'ж' => 'zh',
            'З' => 'Z', 'з' => 'z',
            'И' => 'I', 'и' => 'i',
            'Й' => 'Y', 'й' => 'y',
            'К' => 'K', 'к' => 'k',
            'Л' => 'L', 'л' => 'l',
            'М' => 'M', 'м' => 'm',
            'Н' => 'N', 'н' => 'n',
            'О' => 'O', 'о' => 'o',
            'П' => 'P', 'п' => 'p',
            'Р' => 'R', 'р' => 'r',
            'С' => 'S', 'с' => 's',
            'Т' => 'T', 'т' => 't',
            'У' => 'U', 'у' => 'u',
            'Ф' => 'F', 'ф' => 'f',
            'Х' => 'H', 'х' => 'h',
            'Ц' => 'Ts', 'ц' => 'ts',
            'Ч' => 'Ch', 'ч' => 'ch',
            'Ш' => 'Sh', 'ш' => 'sh',
            'Щ' => 'Sht', 'щ' => 'sht',
            'Ъ' => 'A', 'ъ' => 'a',
            'Ь' => 'Y', 'ь' => 'y',
            'Ю' => 'Yu', 'ю' => 'yu',
            'Я' => 'Ya', 'я' => 'ya',
         );
TonyZ
 
Posts: 2
Joined: Sat Oct 31, 2009 6:43 am
Location: Bulgaria

Re: Custom replacement for title injection

Postby dcz » Sat Mar 27, 2010 2:16 pm

Thanks for sharing ;)

Could you just elaborate a bit on the differences (since I'm not fluent in Bulgarian or Russian, and that may be good to know for those who'll need this tweak) ?

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: Custom replacement for title injection

Postby TonyZ » Mon Mar 29, 2010 9:44 am

Hi,
The differences you can see them on this online converter:
http://2cyr.com/?7
They have very small differences.
Regards
TonyZ
 
Posts: 2
Joined: Sat Oct 31, 2009 6:43 am
Location: Bulgaria

Re: Custom replacement for title injection

Postby Widmo » Fri Dec 10, 2010 3:18 am

For Polish users:
Code: Select all
  $this->url_replace = array(
             'ś' => 's',
             'ł' => 'l',
             'ą' => 'a',
             'ż' => 'z',
             'ź' => 'z',
             'ę' => 'e',
             'ć' => 'c',
             'ó' => 'o',
             'ń' => 'n',
             'Ś' => 'S',
             'Ł' => 'L',
             'Ą' => 'A',
             'Ż' => 'Z',
             'Ź' => 'Z',
             'Ę' => 'E',
             'Ć' => 'C',
             'Ó' => 'O',
             'Ń' => 'N',
          );
Widmo
 
Posts: 4
Joined: Fri Dec 10, 2010 3:10 am

Re: Custom replacement for title injection

Postby Goroman » Fri May 13, 2011 5:15 am

sorry for bumping old topic , but i have problem with polish char-set (1 post up)

this is my setup_phpbb_seo.php
http://www.wupload.com/file/380832/setup_phpbb_seo.php

I have newest premod version

All i done it was:
i added my special chars, saved as uft8 without BoM

I "Reset all topic URLs"
and then "Start topic URLs synchronization"

but it didnt give me any results .. i still have "-" instead of my replacement.

pls help :)
User avatar
Goroman
PR1
PR1
 
Posts: 139
Joined: Fri Mar 28, 2008 2:58 pm
Location: Poland

Re: Custom replacement for title injection

Postby dcz » Sun May 15, 2011 4:33 pm

Have you noticed that you need to add upper and lower cases ?
Have you tried widmo's suggestion just above ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: Custom replacement for title injection

Postby Goroman » Mon May 16, 2011 5:10 am

omg i forgot about capital letters, ty dcz :)
User avatar
Goroman
PR1
PR1
 
Posts: 139
Joined: Fri Mar 28, 2008 2:58 pm
Location: Poland

Re: Custom replacement for title injection

Postby bstyle242 » Sat Dec 03, 2011 5:56 pm

tks so much! :)
bstyle242
 
Posts: 1
Joined: Sat Dec 03, 2011 5:00 pm

Re: Custom replacement for title injection

Postby olalavui » Sun Jul 15, 2012 6:56 pm

Thanks you!
User avatar
olalavui
 
Posts: 3
Joined: Sun Sep 06, 2009 2:19 am
Location: Vietnam

Re: Custom replacement for title injection

Postby MAzZY » Mon Mar 04, 2013 10:36 am

Full Cyrillic char-set

Code: Select all
      // Custom characters replacement for Cyrillic char-set
      $this->url_replace = array(
      'А' => 'A', 'а' => 'a',
      'Б' => 'B', 'б' => 'b',
      'В' => 'V', 'в' => 'v',
      'Г' => 'G', 'г' => 'g',
      'Д' => 'D', 'д' => 'd',
      'Е' => 'E', 'е' => 'e',
      'Ё' => 'Yo', 'ё' => 'yo',
      'Ж' => 'Zh', 'ж' => 'zh',
      'З' => 'Z', 'з' => 'z',
      'И' => 'I', 'и' => 'i',
      'Й' => 'Y', 'й' => 'y',
      'К' => 'K', 'к' => 'k',
      'Л' => 'L', 'л' => 'l',
      'М' => 'M', 'м' => 'm',
      'Н' => 'N', 'н' => 'n',
      'О' => 'O', 'о' => 'o',
      'П' => 'P', 'п' => 'p',
      'Р' => 'R', 'р' => 'r',
      'С' => 'S', 'с' => 's',
      'Т' => 'T', 'т' => 't',
      'У' => 'U', 'у' => 'u',
      'Ф' => 'F', 'ф' => 'f',
      'Х' => 'H', 'х' => 'h',
      'Ц' => 'C', 'ц' => 'c',
      'Ч' => 'CH', 'ч' => 'ch',
      'Ш' => 'SH', 'ш' => 'sh',
      'Щ' => 'SHH', 'щ' => 'shh',
      'Ъ' => '', 'ъ' => '',
      'Ы' => 'Y', 'ы' => 'y',
      'Ь' => '', 'ь' => '',
      'Э' => 'E', 'э' => 'e',
      'Ю' => 'YU', 'ю' => 'yu',
      'Я' => 'YA','я' => 'ya',   
      );
Last edited by MAzZY on Wed Jan 29, 2014 11:33 am, edited 1 time in total.
MAzZY
 
Posts: 1
Joined: Sat Dec 20, 2008 10:32 am

Re: Custom replacement for title injection

Postby klahla » Thu Jun 20, 2013 5:47 pm

In 0.7.0 version (did not check other) we no longer see
Code: Select all
      // Let's make sure that settings are consistent
      $this->check_config();

Instead, there is this:
Code: Select all
   /**
   * will make sure that configured options are consistent
   * @access private
   */
   function check_config() {


Someone posted the following on the internet. Just bringing it here to make is easier to find for others.
And, perhaps, for authors to comment.

Find:
Code: Select all
      if ( $this->seo_opt['url_rewrite'] && !defined('ADMIN_START') && isset($this->file_hbase[$this->seo_opt['req_file']])) {
         $this->seo_opt['seo_base_href'] = '<base href="' . $this->file_hbase[$this->seo_opt['req_file']] . '"/>';
      }

Add after:
Code: Select all
// Custom characters replacement
   $url_replace = array(
     'А' => 'A', 'а' => 'a',
     'Б' => 'B', 'б' => 'b',
     'В' => 'V', 'в' => 'v',
     // all your other stuff
);
   $this->seo_opt['url_find'] = array_keys($url_replace);
   $this->seo_opt['url_replace'] = array_values($url_replace);
// Custom characters replacement


Find:
Code: Select all
$url = preg_replace('`\[.*\]`U','',$url);

Add after:
Code: Select all
$url = str_replace( $this->seo_opt['url_find'], $this->seo_opt['url_replace'], $url );


Done.
klahla
 
Posts: 1
Joined: Thu Jun 20, 2013 2:28 pm

Re: Custom replacement for title injection

Postby aditya0426 » Wed May 28, 2014 7:42 pm

can anyone please help me in this thread

message44346
aditya0426
 
Posts: 3
Joined: Wed May 28, 2014 3:21 am

Re: Custom replacement for title injection

Postby kenneths » Wed Aug 20, 2014 9:04 am

Can you advise how to make custom characters replacement for cs-cart seo url?

Thanks.
kenneths
 
Posts: 1
Joined: Wed Aug 20, 2014 9:01 am

PreviousNext

Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests