Skip to content
Permalink
Browse files

19F121

Update Includes:
* fix to resolve pretty basic SQL flaw in GetPagePosts affecting posts with the same slug across sites
* added post.page to non-Social URL formatting
  • Loading branch information...
matigo committed Jun 12, 2019
1 parent 8de4296 commit 5e0c1051694aa55af0ab00962c7a34432ad73c0a
Showing with 5 additions and 5 deletions.
  1. +1 −1 conf/versions.php
  2. +1 −1 lib/posts.php
  3. +3 −3 sql/posts/spGetPagePosts.sql
@@ -4,7 +4,7 @@
* @author Jason F. Irwin
*/
define('APP_VER', '19F120'); // The Application Version
define('APP_VER', '19F121'); // The Application Version
define('CSS_VER', '173'); // The CSS Update Version
define('SQL_VER', '001'); // The SQL Update Version
define('SQL_HASH', '32.312|6d043d93-2047-0143-0019-9a70f020dd80'); // The Hash Expected of the Database
@@ -427,7 +427,7 @@ private function _parsePostResultSet( $rslt ) {
if ( NoNull($Row['reply_to']) != '' ) { $pclass[] = 'p-in-reply-to'; }
$IsNote = true;
if ( in_array(NoNull($Row['post_type']), array('post.article', 'post.quotation', 'post.bookmark')) ) { $IsNote = false; }
if ( in_array(NoNull($Row['post_type']), array('post.article', 'post.quotation', 'post.bookmark', 'post.location', 'post.page')) ) { $IsNote = false; }
$post_text = $this->_getMarkdownHTML($Row['value'], $Row['post_id'], $IsNote, true);
$post_text = $this->_parsePostMentions($post_text);
@@ -55,15 +55,15 @@ BEGIN

/* If we have a specific URL, ensure every post type is acceptable */
IF IFNULL(`in_canon_url`, '') NOT IN ('/article', '/bookmark', '/note', '/quotation', '/location', '/', '') AND IFNULL(`in_tag`, '') = '' THEN
SET `post_types` = 'post.article, post.bookmark, post.note, post.quotation, post.location';
SET `post_types` = 'post.article, post.bookmark, post.note, post.quotation, post.location, post.page';

SELECT tmp.`id` INTO `post_id`
FROM (SELECT po.`id`, po.`publish_at`
FROM `Post` po INNER JOIN `Channel` ch ON po.`channel_id` = ch.`id`
INNER JOIN `Site` si ON ch.`site_id` = si.`id`
WHERE si.`is_deleted` = 'N' and ch.`is_deleted` = 'N' and po.`is_deleted` = 'N'
and IFNULL(po.`expires_at`, DATE_ADD(Now(), INTERVAL 1 MINUTE)) >= Now()
and po.`canonical_url` = `in_canon_url`
and Now() BETWEEN po.`publish_at` AND IFNULL(po.`expires_at`, DATE_ADD(Now(), INTERVAL 1 MINUTE))
and si.`guid` = `in_site_guid` and po.`canonical_url` = `in_canon_url`
UNION ALL
SELECT -1 as `id`, FROM_UNIXTIME(0) as `publish_at`
ORDER BY `publish_at` DESC

0 comments on commit 5e0c105

Please sign in to comment.
You can’t perform that action at this time.