mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
syntax fix, changelog
This commit is contained in:
parent
9a61e8fd48
commit
bde5802a3a
|
@ -1,6 +1,7 @@
|
||||||
# PrivateBin version history
|
# PrivateBin version history
|
||||||
|
|
||||||
* **1.4.1 (not yet released)**
|
* **1.4.1 (not yet released)**
|
||||||
|
* ADDED: script for data storage backend migrations (#1012)
|
||||||
* ADDED: Translations for Turkish, Slovak and Greek
|
* ADDED: Translations for Turkish, Slovak and Greek
|
||||||
* ADDED: S3 Storage backend (#994)
|
* ADDED: S3 Storage backend (#994)
|
||||||
* CHANGED: Avoid `SUPER` privilege for setting the `sql_mode` for MariaDB/MySQL (#919)
|
* CHANGED: Avoid `SUPER` privilege for setting the `sql_mode` for MariaDB/MySQL (#919)
|
||||||
|
|
|
@ -481,7 +481,7 @@ class Database extends AbstractData
|
||||||
// migrate filesystem based salt into database
|
// migrate filesystem based salt into database
|
||||||
$file = 'data' . DIRECTORY_SEPARATOR . 'salt.php';
|
$file = 'data' . DIRECTORY_SEPARATOR . 'salt.php';
|
||||||
if ($namespace === 'salt' && is_readable($file)) {
|
if ($namespace === 'salt' && is_readable($file)) {
|
||||||
$fs = new Filesystem(array('dir' => 'data'));
|
$fs = new Filesystem(array('dir' => 'data'));
|
||||||
$value = $fs->getValue('salt');
|
$value = $fs->getValue('salt');
|
||||||
$this->setValue($value, 'salt');
|
$this->setValue($value, 'salt');
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
|
|
|
@ -409,29 +409,29 @@ class Filesystem extends AbstractData
|
||||||
*/
|
*/
|
||||||
public function getAllPastes()
|
public function getAllPastes()
|
||||||
{
|
{
|
||||||
$pastes = array();
|
$pastes = array();
|
||||||
$subdirs = scandir($this->_path);
|
$subdirs = scandir($this->_path);
|
||||||
if ($subdirs === false) {
|
if ($subdirs === false) {
|
||||||
dieerr("Unable to list directory " . $this->_path);
|
dieerr('Unable to list directory ' . $this->_path);
|
||||||
}
|
}
|
||||||
$subdirs = preg_grep("/^[^.].$/", $subdirs);
|
$subdirs = preg_grep('/^[^.].$/', $subdirs);
|
||||||
|
|
||||||
foreach ($subdirs as $subdir) {
|
foreach ($subdirs as $subdir) {
|
||||||
$subpath = $this->_path . DIRECTORY_SEPARATOR . $subdir;
|
$subpath = $this->_path . DIRECTORY_SEPARATOR . $subdir;
|
||||||
|
|
||||||
$subsubdirs = scandir($subpath);
|
$subsubdirs = scandir($subpath);
|
||||||
if ($subsubdirs === false) {
|
if ($subsubdirs === false) {
|
||||||
dieerr("Unable to list directory " . $subpath);
|
dieerr('Unable to list directory ' . $subpath);
|
||||||
}
|
}
|
||||||
$subsubdirs = preg_grep("/^[^.].$/", $subsubdirs);
|
$subsubdirs = preg_grep('/^[^.].$/', $subsubdirs);
|
||||||
foreach ($subsubdirs as $subsubdir) {
|
foreach ($subsubdirs as $subsubdir) {
|
||||||
$subsubpath = $subpath . DIRECTORY_SEPARATOR . $subsubdir;
|
$subsubpath = $subpath . DIRECTORY_SEPARATOR . $subsubdir;
|
||||||
|
|
||||||
$files = scandir($subsubpath);
|
$files = scandir($subsubpath);
|
||||||
if ($files === false) {
|
if ($files === false) {
|
||||||
dieerr("Unable to list directory " . $subsubpath);
|
dieerr('Unable to list directory ' . $subsubpath);
|
||||||
}
|
}
|
||||||
$files = preg_grep("/\.php$/", $files);
|
$files = preg_grep('/\.php$/', $files);
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if (substr($file, 0, 4) === $subdir . $subsubdir) {
|
if (substr($file, 0, 4) === $subdir . $subsubdir) {
|
||||||
|
|
|
@ -353,7 +353,7 @@ class GoogleCloudStorage extends AbstractData
|
||||||
public function getAllPastes()
|
public function getAllPastes()
|
||||||
{
|
{
|
||||||
$pastes = array();
|
$pastes = array();
|
||||||
$prefix = $this->_prefix;
|
$prefix = $this->_prefix;
|
||||||
if ($prefix != '') {
|
if ($prefix != '') {
|
||||||
$prefix .= '/';
|
$prefix .= '/';
|
||||||
}
|
}
|
||||||
|
@ -361,7 +361,7 @@ class GoogleCloudStorage extends AbstractData
|
||||||
try {
|
try {
|
||||||
foreach ($this->_bucket->objects(array('prefix' => $prefix)) as $object) {
|
foreach ($this->_bucket->objects(array('prefix' => $prefix)) as $object) {
|
||||||
$candidate = substr($object->name(), strlen($prefix));
|
$candidate = substr($object->name(), strlen($prefix));
|
||||||
if (strpos($candidate, "/") === false) {
|
if (strpos($candidate, '/') === false) {
|
||||||
$pastes[] = $candidate;
|
$pastes[] = $candidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,15 +453,15 @@ class S3Storage extends AbstractData
|
||||||
public function getAllPastes()
|
public function getAllPastes()
|
||||||
{
|
{
|
||||||
$pastes = array();
|
$pastes = array();
|
||||||
$prefix = $this->_prefix;
|
$prefix = $this->_prefix;
|
||||||
if ($prefix != '') {
|
if ($prefix != '') {
|
||||||
$prefix .= '/';
|
$prefix .= '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
foreach ($this->_listAllObjects($prefix) as $object) {
|
foreach ($this->_listAllObjects($prefix) as $object) {
|
||||||
$candidate = substr($object["Key"], strlen($prefix));
|
$candidate = substr($object['Key'], strlen($prefix));
|
||||||
if (strpos($candidate, "/") === false) {
|
if (strpos($candidate, '/') === false) {
|
||||||
$pastes[] = $candidate;
|
$pastes[] = $candidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ class Model
|
||||||
public function getStore()
|
public function getStore()
|
||||||
{
|
{
|
||||||
if ($this->_store === null) {
|
if ($this->_store === null) {
|
||||||
$class = 'PrivateBin\\Data\\' . $this->_conf->getKey('class', 'model');
|
$class = 'PrivateBin\\Data\\' . $this->_conf->getKey('class', 'model');
|
||||||
$this->_store = new $class($this->_conf->getSection('model_options'));
|
$this->_store = new $class($this->_conf->getSection('model_options'));
|
||||||
}
|
}
|
||||||
return $this->_store;
|
return $this->_store;
|
||||||
|
|
|
@ -156,7 +156,7 @@ class ModelTest extends PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
public function testCommentDefaults()
|
public function testCommentDefaults()
|
||||||
{
|
{
|
||||||
$class = 'PrivateBin\\Data\\' . $this->_conf->getKey('class', 'model');
|
$class = 'PrivateBin\\Data\\' . $this->_conf->getKey('class', 'model');
|
||||||
$comment = new Comment(
|
$comment = new Comment(
|
||||||
$this->_conf,
|
$this->_conf,
|
||||||
new $class(
|
new $class(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user