mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7243 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
67f55ba53e
commit
352b121220
4 changed files with 64 additions and 43 deletions
3
cake/libs/cache/file.php
vendored
3
cake/libs/cache/file.php
vendored
|
@ -171,8 +171,9 @@ class FileEngine extends CacheEngine {
|
|||
if ($data !== '' && !empty($this->settings['serialize'])) {
|
||||
if (substr(PHP_OS, 0, 3) == "WIN") {
|
||||
$data = str_replace('\\\\\\\\', '\\', $data);
|
||||
}
|
||||
$data = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $data);
|
||||
}
|
||||
|
||||
$data = unserialize($data);
|
||||
}
|
||||
$this->__File->close();
|
||||
|
|
8
cake/tests/cases/libs/cache/file.test.php
vendored
8
cake/tests/cases/libs/cache/file.test.php
vendored
|
@ -331,5 +331,13 @@ class FileEngineTest extends CakeTestCase {
|
|||
$this->assertEqual($expected, $data);
|
||||
}
|
||||
|
||||
function testWriteQuotedString() {
|
||||
Cache::engine('File', array('path' => TMP . 'tests'));
|
||||
Cache::write('App.doubleQuoteTest', '"this is a quoted string"');
|
||||
$this->assertIdentical(Cache::read('App.doubleQuoteTest'), '"this is a quoted string"');
|
||||
Cache::write('App.singleQuoteTest', "'this is a quoted string'");
|
||||
$this->assertIdentical(Cache::read('App.singleQuoteTest'), "'this is a quoted string'");
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1876,6 +1876,16 @@ EOD;
|
|||
$result = __('No Translation needed', true);
|
||||
$this->assertEqual($result, 'No Translation needed');
|
||||
}
|
||||
/**
|
||||
* testPoQuotedString method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoQuotedString () {
|
||||
$expected = 'this is a "quoted string" (translated)';
|
||||
$this->assertEqual(__('this is a "quoted string"', true), $expected);
|
||||
}
|
||||
/**
|
||||
* Singular method
|
||||
*
|
||||
|
|
|
@ -69,3 +69,5 @@ msgstr[0] "v \n"
|
|||
msgstr[1] "vs \n"
|
||||
"second line"
|
||||
|
||||
msgid "this is a \"quoted string\""
|
||||
msgstr "this is a \"quoted string\" (translated)"
|
Loading…
Reference in a new issue