Problem with cyrillic blognames after new blog registration

Problem with cyrillic blognames after new blog registration

Postby Char0day on Thu Mar 20, 2008 6:09 pm

Hi all,
The blog name, used in 2-nd step of registration looks bad when user go to 4 step of registration.
If I look in database, I can see string like
Code: Select all
Íàçâàí
in blog field of table myPrefix_blogs.
If I debug (log in file values of variables) $this->_request->GetValue("blogname") in class/summary/action/doblogregistration.class.php
I can see Íàçâà&iacute string (tha same as in db)
While step 2 I use plugin live http headers for firefox and this is headers post on server with blogname:
Code: Select all
Content-Type: application/x-www-form-urlencoded
Content-Length: 173
blogName=%CD%E0%E7%E2%E0%ED%E8%E5+%E1%EB%EE%E3%E0&blogSubDomain=prim&blogMainDomain=mydomain.name&blogCategoryId=2&blogLocale=ru_RU&%C2%EF%E5%F0%E5%E4=%C2%EF%E5%F0%E5%E4+%BB
HTTP/1.x 200 OK
Date: Thu, 20 Mar 2008 13:08:21 GMT
Server: Apache/2.2.8 (FreeBSD) PHP/5.2.5 with Suhosin-Patch mod_jk/1.2.19 mod_ssl/2.2.8 OpenSSL/0.9.7e-p1
X-Powered-By: PHP/5.2.5
Connection: close
Content-Type: text/html;charset=windows-1251


After registering blog, user can change blog name and it changing to correct cyrillic name.

Where is error?
Thanks :)
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka

Re: Problem with cyrillic blognames after new blog registration

Postby Char0day on Fri Mar 21, 2008 11:04 am

I think, I Find solution.
In class file class/summary/action/doblogregistration.class.php
I change $this->_request->getValue("value_name") on $this->_request->_prop["value_name"]:

Code: Select all
        function perform()
        {
            // create the new view and clean the cache
            $this->_view = new BlogTemplateChooserView();
            $this->setCommonData();
                        // save data to the session
                SessionManager::setSessionValue( "blogName", $this->_request->_props["blogName"]);
           // print_r($this->_request);
           // print_r($this->_request->_props["blogName"]);
                SessionManager::setSessionValue( "blogCategoryId", $this->_request->_props["blogCategoryId"]);
                SessionManager::setSessionValue( "blogLocale", $this->_request->_props["blogLocale"]);
                SessionManager::setSessionValue( "blogSubDomain", $this->_request->_props["blogSubDomain"]);
                SessionManager::setSessionValue( "blogMainDomain", $this->_request->_props["blogMainDomain"]);
                SessionManager::setSessionValue( "blogDomain", $this->blogDomain );
                        return( true );
        }


When I debug with print_r($this->_request), I get

Code: Select all
Request Object
(
       [_props] => Array
        (
            [blogName] => блог
            [blogSubDomain] => qwe
            [blogMainDomain] => mydomain.name
            [blogCategoryId] => 2
            [blogLocale] => ru_RU
            [Вперед] => Вперед »
            [bb2_screener_] => 1206091860 77.35.183.196
            [LThttpmydomainname] => bf8465b8540958a7656bc4f5fd16ca44
            [LThttpmydomainname] => 7bf9665b17b25ccf456daeecc8925a0e
        )
)


P.S. I am update my blogs from version 1.2.4 to 1.2.5 and then from 1.2.5 to 1.2.6.
Is such error there in clear 1.2.6 version not from upgrade?
I make test register in another cyrillic lifetype installation (not on my site) and there were no any cyrillic problems duaring registration. My mind is lost in many possible explaining versions.
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka

Re: Problem with cyrillic blognames after new blog registration

Postby jondaley on Fri Mar 21, 2008 11:54 am

I am not entirely following what you are saying, but there was some extra validation/security code added in the getValue call in one of the last versions, I am not sure which one. That is probably what you are running into. You have two choices - one is to fix the validation code, and then let us know how you did it via bugs.lifetype.net so it can be incorporated into the next version (we will only accept it if it doesn't cause a security problem). Or use your code the way you changed it, but then do some validation on it yourself before passing it into the database, so you don't open yourself up to a security hole. We won't be interested in your code if you do it that way, but might be the simplest for you to fix.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Problem with cyrillic blognames after new blog registration

Postby Char0day on Fri Mar 21, 2008 12:15 pm

jondaley wrote:but there was some extra validation/security code added in the getValue call in one of the last versions, I am not sure which one.

So, I don't understand, why I can change blog name in cyrillic symbols without any problems in "Admin interface"->"blog settings" after installation. That's mean when I edit blog settings, security functions not used?

Somewhere (I not find yet) in LifeType code, may bee in some security functions(classes) there are some latin to UTF-8 (or UTF8 to latin) conversion, I think.
Because after blog registration cyrillic blogName became a sting like this:Íàçâà&iacute.
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka


Return to Localization

cron