equal
deleted
inserted
replaced
46 |
46 |
47 // Prevent unnecessary work |
47 // Prevent unnecessary work |
48 if ( $local_namespace != 'File' ) |
48 if ( $local_namespace != 'File' ) |
49 return null; |
49 return null; |
50 |
50 |
51 $selfn = $local_page_id; |
51 $selfn = $db->escape($this->page_id); |
52 if ( substr($paths->cpage['name'], 0, strlen($paths->nslist['File'])) == $paths->nslist['File']) |
|
53 { |
|
54 $selfn = substr($local_page_id, strlen($paths->nslist['File']), strlen($local_page_id)); |
|
55 } |
|
56 $selfn = $db->escape($selfn); |
|
57 $q = $db->sql_query('SELECT f.mimetype,f.time_id,f.size,l.log_id FROM ' . table_prefix . "files AS f\n" |
52 $q = $db->sql_query('SELECT f.mimetype,f.time_id,f.size,l.log_id FROM ' . table_prefix . "files AS f\n" |
58 . " LEFT JOIN " . table_prefix . "logs AS l\n" |
53 . " LEFT JOIN " . table_prefix . "logs AS l\n" |
59 . " ON ( l.time_id = f.time_id AND ( l.action = 'reupload' OR l.action IS NULL ) )\n" |
54 . " ON ( l.time_id = f.time_id AND ( l.action = 'reupload' OR l.action IS NULL ) )\n" |
60 . " WHERE f.page_id = '$selfn'\n" |
55 . " WHERE f.page_id = '$selfn'\n" |
61 . " ORDER BY f.time_id DESC;"); |
56 . " ORDER BY f.time_id DESC;"); |