summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/changelog.php10
-rw-r--r--inc/common.php2
-rw-r--r--inc/pageutils.php4
3 files changed, 8 insertions, 8 deletions
diff --git a/inc/changelog.php b/inc/changelog.php
index d21c31198..937214a6a 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -151,7 +151,7 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='',
* RECENTS_SKIP_DELETED - don't include deleted pages
* RECENTS_SKIP_MINORS - don't include minor changes
* RECENTS_SKIP_SUBSPACES - don't include subspaces
- * RECENTS_MEDIA_CHANGES - return media changes instead of page changes
+ * RECENTS_SKIP_PAGES - return media changes instead of page changes
* RECENTS_INCLUDE_MEDIA - return both media changes and page changes
*
* @param int $first number of first entry returned (for paginating
@@ -171,7 +171,7 @@ function getRecents($first,$num,$ns='',$flags=0){
return $recent;
// read all recent changes. (kept short)
- if ($flags & RECENTS_MEDIA_CHANGES) {
+ if ($flags & RECENTS_SKIP_PAGES) {
$lines = @file($conf['media_changelog']);
} else {
$lines = @file($conf['changelog']);
@@ -229,7 +229,7 @@ function getRecents($first,$num,$ns='',$flags=0){
* RECENTS_SKIP_DELETED - don't include deleted pages
* RECENTS_SKIP_MINORS - don't include minor changes
* RECENTS_SKIP_SUBSPACES - don't include subspaces
- * RECENTS_MEDIA_CHANGES - return media changes instead of page changes
+ * RECENTS_SKIP_PAGES - return media changes instead of page changes
*
* @param int $from date of the oldest entry to return
* @param int $to date of the newest entry to return (for pagination, optional)
@@ -247,7 +247,7 @@ function getRecentsSince($from,$to=null,$ns='',$flags=0){
return $recent;
// read all recent changes. (kept short)
- if ($flags & RECENTS_MEDIA_CHANGES) {
+ if ($flags & RECENTS_SKIP_PAGES) {
$lines = @file($conf['media_changelog']);
} else {
$lines = @file($conf['changelog']);
@@ -314,7 +314,7 @@ function _handleRecent($line,$ns,$flags,&$seen){
if ($recent['perms'] < AUTH_READ) return false;
// check existance
- $fn = (($flags & RECENTS_MEDIA_CHANGES) ? mediaFN($recent['id']) : wikiFN($recent['id']));
+ $fn = (($flags & RECENTS_SKIP_PAGES) ? mediaFN($recent['id']) : wikiFN($recent['id']));
if((!@file_exists($fn)) && ($flags & RECENTS_SKIP_DELETED)) return false;
return $recent;
diff --git a/inc/common.php b/inc/common.php
index e0405a735..acd3609d6 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -14,7 +14,7 @@ if(!defined('DOKU_INC')) die('meh.');
define('RECENTS_SKIP_DELETED',2);
define('RECENTS_SKIP_MINORS',4);
define('RECENTS_SKIP_SUBSPACES',8);
-define('RECENTS_MEDIA_CHANGES',16);
+define('RECENTS_SKIP_PAGES',16);
define('RECENTS_INCLUDE_MEDIA',32);
/**
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 37b15a498..09a23cbdd 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -347,8 +347,8 @@ function mediaFN($id, $rev=''){
$fn = $conf['mediadir'].'/'.utf8_encodeFN($id);
}else{
$ext = mimetype($id);
- $name = substr($id, 0, strrpos($id, '.'));
- $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name).'.'.(int)$rev.'.'.utf8_encodeFN($ext[0]);
+ $name = substr($id,0, -1*strlen($ext[0]));
+ $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name .'.'.( (int) $rev ).'.'.$ext[0]);
}
return $fn;
}