Fork me on GitHub

Changes for #1052

Description changed by Visman (2015-10-31 11:14:30)

 1:  1:
 1. Doesn't correspond to the description 1. Doesn't correspond to the description
 [code]  [code]
  // Replace multiple whitespace or dashes   // Replace multiple whitespace or dashes
  $text = preg_replace('%(\s){2,}%u', '\1', $text);   $text = preg_replace('%(\s){2,}%u', '\1', $text);
 [/code] [/code]
  
 Need Need
 [code]  [code]
  // Replace multiple whitespace or dashes   // Replace multiple whitespace or dashes
- $text = preg_replace('%([\s-]){2,}%u', '\1', $text); + $text = preg_replace('%([\s-])\1{1,}%u', '\1', $text);
 [/code] [/code]
 or or
 [code]  [code]
  // Replace multiple whitespace   // Replace multiple whitespace
- $text = preg_replace('%(\s){2,}%u', ' ', $text); + $text = preg_replace('%\s{2,}%u', ' ', $text);
 [/code] [/code]
  
 2. It is necessary to clean conjoint words with bb-codes. Example: word "естьhttp" for post 2. It is necessary to clean conjoint words with bb-codes. Example: word "естьhttp" for post
 [code]  [code]
 ...есть[url=http://...  ...есть[url=http://...
 [/code] [/code]
  
 In strip_bbcode function  In strip_bbcode function 
 [code]  [code]
  '%\[img=([^\]]*+)\]([^[]*+)\[/img\]%' => '$2 $1', // Keep the url and description   '%\[img=([^\]]*+)\]([^[]*+)\[/img\]%' => '$2 $1', // Keep the url and description
  '%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => '$2 $3', // Keep the url and text   '%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => '$2 $3', // Keep the url and text
  '%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => '$2', // Keep the url   '%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => '$2', // Keep the url
   
 [/code] [/code]
 replace replace
 [code]  [code]
  '%\[img=([^\]]*+)\]([^[]*+)\[/img\]%' => ' $2 $1 ', // Keep the url and description   '%\[img=([^\]]*+)\]([^[]*+)\[/img\]%' => ' $2 $1 ', // Keep the url and description
  '%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => ' $2 $3 ', // Keep the url and text   '%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => ' $2 $3 ', // Keep the url and text
  '%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => ' $2 ', // Keep the url   '%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%' => ' $2 ', // Keep the url
   
 [/code] [/code]
  
 3. Addition for split_words() function: 3. Addition for split_words() function:
 after after
 [code]  [code]
  // Remove BBCode   // Remove BBCode
  $text = preg_replace('%\[/?(b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%', ' ', $text);   $text = preg_replace('%\[/?(b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%', ' ', $text);
 [/code] [/code]
 add add
 [code]  [code]
  $text = str_replace(array('`', '’', 'ё'), array('\'', '\'', 'е'), $text); // russian letter "ё" replaced by russian letter "е" and apostrophe/closing single quotation mark replaced by single quotation mark   $text = str_replace(array('`', '’', 'ё'), array('\'', '\'', 'е'), $text); // russian letter "ё" replaced by russian letter "е" and apostrophe/closing single quotation mark replaced by single quotation mark
   
 [/code] [/code]