[BUGFIX] Fixes media library regression, references #509
Adds missing ACL renames Missing trailing / when managing dirs Fix typo that did not evaluate read/write properly Add missing NEWS entries
This commit is contained in:
parent
b8745330e4
commit
0dc6f620c1
13
docs/NEWS
13
docs/NEWS
@ -2,6 +2,19 @@
|
||||
Version 2.2.1-alpha2 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Fix bug with not properly adding trailing "/" when managing
|
||||
directories, so that saving different permissions would not
|
||||
be properly applied
|
||||
|
||||
* Re-add missing plugin API event hook backend_media_rename
|
||||
from prior pmigration in Serendipity 2.2 (#509)
|
||||
|
||||
* Re-add missing ACL adjustments after renaming a directory
|
||||
(#509)
|
||||
|
||||
* Fix typo that switched read permissions with write permissions
|
||||
when editing a category ACL
|
||||
|
||||
Version 2.2.1-alpha1 (September 20th, 2018)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
@ -471,7 +471,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
// preserve moving subdir directories to serendipity_makeFilename(), preserves dir/subdir/ for example
|
||||
$_newDir = $serendipity['POST']['newDir'];
|
||||
$newfile = serendipity_makeFilename(basename($_newDir));
|
||||
$newDir = (dirname($_newDir) != '.') ? dirname($_newDir) . '/' . $newfile : $newfile;
|
||||
$newDir = (dirname($_newDir) != '.') ? dirname($_newDir) . '/' . $newfile : $newfile . '/';
|
||||
$oldDir = serendipity_uploadSecure($serendipity['POST']['oldDir']);
|
||||
|
||||
if ($oldDir != $newDir) {
|
||||
|
@ -2171,6 +2171,25 @@ function serendipity_renameDir($oldDir, $newDir) {
|
||||
$total = null;
|
||||
$images = serendipity_fetchImagesFromDatabase(0, 0, $total, false, false, $oldDir);
|
||||
|
||||
// Perform ACL renames
|
||||
$dirs = serendipity_db_query("SELECT groupid, artifact_id, artifact_type, artifact_mode, artifact_index
|
||||
FROM {$serendipity['dbPrefix']}access
|
||||
WHERE artifact_type = 'directory'
|
||||
AND artifact_index LIKE '" . serendipity_db_escape_string($oldDir) . "%'", false, 'assoc');
|
||||
if (is_array($dirs)) {
|
||||
foreach($dirs AS $dir) {
|
||||
$old = $dir['artifact_index'];
|
||||
$new = preg_replace('@^(' . preg_quote($oldDir) . ')@i', $newDir, $old);
|
||||
serendipity_db_query("UPDATE {$serendipity['dbPrefix']}access
|
||||
SET artifact_index = '" . serendipity_db_escape_string($new) . "'
|
||||
WHERE groupid = '" . serendipity_db_escape_string($dir['groupid']) . "'
|
||||
AND artifact_id = '" . serendipity_db_escape_string($dir['artifact_id']) . "'
|
||||
AND artifact_type = '" . serendipity_db_escape_string($dir['artifact_type']) . "'
|
||||
AND artifact_mode = '" . serendipity_db_escape_string($dir['artifact_mode']) . "'
|
||||
AND artifact_index = '" . serendipity_db_escape_string($dir['artifact_index']) . "'");
|
||||
}
|
||||
}
|
||||
|
||||
if (! file_exists("${imgBase}${newDir}")) {
|
||||
rename("${imgBase}${oldDir}", "${imgBase}${newDir}");
|
||||
|
||||
|
@ -118,7 +118,7 @@
|
||||
<select id="write_authors" size="6" multiple name="serendipity[cat][write_authors][]">
|
||||
<option value="0"{if $selectAllReadAuthors} selected{/if}>{$CONST.ALL_AUTHORS}</option>
|
||||
{foreach $groups as $group}
|
||||
<option value="{$group.confkey}"{if isset($read_groups.{$group.confkey})} selected{/if}>{$group.confvalue|escape}</option>
|
||||
<option value="{$group.confkey}"{if isset($write_groups.{$group.confkey})} selected{/if}>{$group.confvalue|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user