ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 12550


Ignore:
Timestamp:
Aug 6, 2009, 8:39:13 PM (13 years ago)
Author:
fukamachi
Message:

fixed sfWebRequest::$getParameters didn't be encoded to ShiftJIS on mobile_frontend

Location:
OpenPNE3/trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/filter/sfMobileIOFilter.class.php

    r12164 r12550  
    3535    $this->convertEmojiForInput();
    3636    $this->convertEncodingForInput();
     37    sfContext::getInstance()->getRequest()->convertEncodingParametersToSJIS();
    3738
    3839    $filterChain->execute();
  • OpenPNE3/trunk/lib/request/sfOpenPNEWebRequest.class.php

    r12140 r12550  
    229229    }
    230230  }
     231
     232  public function convertEncodingParametersToSJIS()
     233  {
     234    foreach (array('getParameters', 'postParameters', 'requestParameters') as $parameters)
     235    {
     236      foreach ($this->$parameters as $key => $value)
     237      {
     238        if (0 !== stripos($key, '_sf_'))
     239        {
     240          $this->{$parameters}[$key] = $this->convertEncodingParametersToSJISCallback($value);
     241        }
     242      }
     243    }
     244  }
     245
     246  private function convertEncodingParametersToSJISCallback($value)
     247  {
     248    if (is_array($value))
     249    {
     250      return array_map(array($this, 'convertEncodingParametersToSJISCallback'), $value);
     251    }
     252
     253    return mb_convert_encoding($value, 'UTF-8', 'SJIS-win');
     254  }
    231255}
Note: See TracChangeset for help on using the changeset viewer.