Jump to content

'Stop shouting in topic title', give more options.


Recommended Posts

Although that can be a nice feature for some boards, That's not going to fix the original bug reported. ucwords does not work well with languages such as Russian, Turkish, Hebrew etc.. Consider the following:

<?php

header('Content-Type: text/html; charset=UTF-8');

$word = "THIS is A TestinG SENTENCE";
echo ucwords($word);
echo "nn<br /><br />";
$word = "Ючю эю пожжэ компльыктётюр. Граэки дэфянятйоныс шэа ед";
echo ucwords($word);
echo "nn<br /><br />";
$word = "Ючю эю пожжэ компльыктётюр. Граэки дэфянятйоныс шэа ед";
echo mb_convert_case($word, MB_CASE_TITLE, "UTF-8");

Which will output:

THIS Is A TestinG SENTENCE 

Ючю эю пожжэ компльыктётюр. Граэки дэфянятйоныс шэа ед 

Ючю Эю Пожжэ Компльыктётюр. Граэки Дэфянятйоныс Шэа Ед

Notice the difference in the 2nd and 3rd lines (last 3 words first letter).

Link to comment
Share on other sites

That's right. I haven't even tested this in the forums but i see that they are actually using the mb_* functions

if( $this->settings['etfilter_shout'] )
			{
				if( function_exists('mb_convert_case') )
				{
					if( in_array( strtolower( $this->settings['gb_char_set'] ), array_map( 'strtolower', mb_list_encodings() ) ) )
					{
						$this->_topicTitle = mb_convert_case( $this->_topicTitle, MB_CASE_TITLE, $this->settings['gb_char_set'] );
					}
					else
					{
						$this->_topicTitle = ucwords( strtolower($this->_topicTitle) );
					}
				}
				else
				{
					$this->_topicTitle = ucwords( strtolower($this->_topicTitle) );
				}
			}

So the reported bug is not actually a bug.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...