Skip to content

Commit 533993c

Browse files
Merge branch '3.4'
* 3.4: [Bridge\ProxyManager] Dont call __destruct() on non-instantiated services Consistently use 7 chars of sha256 for hash-based id generation Docblock improvement bumped Symfony version to 2.8.27 updated VERSION for 2.8.26 updated CHANGELOG for 2.8.26 bumped Symfony version to 2.7.34 updated VERSION for 2.7.33 update CONTRIBUTORS for 2.7.33 updated CHANGELOG for 2.7.33
2 parents aa5d700 + 05ef409 commit 533993c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Store/FlockStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private function lock(Key $key, $blocking)
7171
$fileName = sprintf('%s/sf.%s.%s.lock',
7272
$this->lockPath,
7373
preg_replace('/[^a-z0-9\._-]+/i', '-', $key),
74-
hash('sha256', $key)
74+
strtr(substr(base64_encode(hash('sha256', $key, true)), 0, 7), '/', '_')
7575
);
7676

7777
// Silence error reporting

Tests/Store/FlockStoreTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ public function testSaveSanitizeName()
6262
$key = new Key('<?php echo "% hello word ! %" ?>');
6363

6464
$file = sprintf(
65-
'%s/sf.-php-echo-hello-word-.4b3d9d0d27ddef3a78a64685dda3a963e478659a9e5240feaf7b4173a8f28d5f.lock',
66-
sys_get_temp_dir()
65+
'%s/sf.-php-echo-hello-word-.%s.lock',
66+
sys_get_temp_dir(),
67+
strtr(substr(base64_encode(hash('sha256', $key, true)), 0, 7), '/', '_')
6768
);
6869
// ensure the file does not exist before the store
6970
@unlink($file);

0 commit comments

Comments
 (0)