From jondaley at devel.lifetype.net Wed Jan 12 11:40:49 2022 From: jondaley at devel.lifetype.net (jondaley at devel.lifetype.net) Date: Wed, 12 Jan 2022 11:40:49 -0500 Subject: [pLog-svn] r7255 - plugins/branches/lifetype-1.2/tagcloud Message-ID: <20220112164049.A02A9BA0001@minneola.limedaley.com> Author: jondaley Date: 2022-01-12 11:40:49 -0500 (Wed, 12 Jan 2022) New Revision: 7255 Modified: plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php Log: mysql_escape_string doesn't exist any more. we just need a number, so this is easy Modified: plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php =================================================================== --- plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php 2020-10-15 04:20:08 UTC (rev 7254) +++ plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php 2022-01-12 16:40:49 UTC (rev 7255) @@ -153,7 +153,7 @@ $bannedwords = $blogSettings->getValue( "plugin_tagcloud_banned_keywords" ); $bannedwords = explode(",", strtolower($bannedwords)); - $MaxArticles = mysql_escape_string($MaxArticles); + $MaxArticles = preg_replace("/[^0-9]/", "", $MaxArticles); $query = "SELECT t.normalized_text,t.normalized_topic FROM " . $prefix . "articles a, " . $prefix."articles_text t" . @@ -311,4 +311,4 @@ } } -?> \ No newline at end of file +?> From jondaley at devel.lifetype.net Wed Jan 12 12:42:22 2022 From: jondaley at devel.lifetype.net (jondaley at devel.lifetype.net) Date: Wed, 12 Jan 2022 12:42:22 -0500 Subject: [pLog-svn] r7256 - plugins/branches/lifetype-1.2/subscribe Message-ID: <20220112174222.8DDD6BA0001@minneola.limedaley.com> Author: jondaley Date: 2022-01-12 12:42:22 -0500 (Wed, 12 Jan 2022) New Revision: 7256 Modified: plugins/branches/lifetype-1.2/subscribe/pluginsubscribe.class.php Log: don't do anything when adding posts or comments if the plugin is installed but not enabled Modified: plugins/branches/lifetype-1.2/subscribe/pluginsubscribe.class.php =================================================================== --- plugins/branches/lifetype-1.2/subscribe/pluginsubscribe.class.php 2022-01-12 16:40:49 UTC (rev 7255) +++ plugins/branches/lifetype-1.2/subscribe/pluginsubscribe.class.php 2022-01-12 17:42:22 UTC (rev 7256) @@ -118,6 +118,9 @@ switch($eventType){ case EVENT_POST_POST_ADD: + if(!$this->isEnabled()) + return; + $article = $params["article"]; if(!$article || $article->getStatus() != POST_STATUS_PUBLISHED) return; @@ -150,6 +153,9 @@ break; case EVENT_POST_COMMENT_ADD: + if(!$this->isEnabled()) + return; + lt_include(PLOG_CLASS_PATH. "class/dao/usercomment.class.php"); lt_include(PLOG_CLASS_PATH. @@ -233,4 +239,4 @@ } } -?> \ No newline at end of file +?> From jondaley at devel.lifetype.net Wed Jan 12 12:45:54 2022 From: jondaley at devel.lifetype.net (jondaley at devel.lifetype.net) Date: Wed, 12 Jan 2022 12:45:54 -0500 Subject: [pLog-svn] r7257 - in plugins/branches/lifetype-1.2/moblog: . class/moblog class/security install Message-ID: <20220112174554.C161BBA0001@minneola.limedaley.com> Author: jondaley Date: 2022-01-12 12:45:54 -0500 (Wed, 12 Jan 2022) New Revision: 7257 Modified: plugins/branches/lifetype-1.2/moblog/class/moblog/moblogrequest.class.php plugins/branches/lifetype-1.2/moblog/class/security/moblogbatchfilter.class.php plugins/branches/lifetype-1.2/moblog/install/moblog.php plugins/branches/lifetype-1.2/moblog/pluginmoblog.class.php Log: updated with some more fields that might be useful Modified: plugins/branches/lifetype-1.2/moblog/class/moblog/moblogrequest.class.php =================================================================== --- plugins/branches/lifetype-1.2/moblog/class/moblog/moblogrequest.class.php 2022-01-12 17:42:22 UTC (rev 7256) +++ plugins/branches/lifetype-1.2/moblog/class/moblog/moblogrequest.class.php 2022-01-12 17:45:54 UTC (rev 7257) @@ -19,6 +19,7 @@ var $_globalCategory; var $_articleCategories; var $_blogId; + var $_date; var $_blogName; var $_attachments; var $_inputEncoding; @@ -42,6 +43,7 @@ // by a default user and blog id cannot be used as 'gateways' isset( $request["blogId"] ) ? $this->_blogId = $request["blogId"] : $this->_blogId = ""; isset( $request["user"] ) ? $this->_user = $request["user"] : $this->_user = ""; + isset( $request["date"] ) ? $this->_date = $request["date"] : $this->_date = ""; isset( $request["password"] ) ? $this->_pass = $request["password"] : $this->_pass = ""; $this->_articlecategories = ""; @@ -76,9 +78,9 @@ $this->parseBody( $structure->body ); $this->_inputEncoding = strtoupper( $structure->ctype_parameters['charset'] ); - MoblogLogger::log( "There are ".count($structure->parts)." MIME parts available to parse" ); + MoblogLogger::log( "There are ". at count($structure->parts)." MIME parts available to parse" ); - if(count($structure->parts) > 0) { + if(@count($structure->parts) > 0) { $this->parseMimeParts( $structure->parts ); } @@ -103,61 +105,75 @@ */ function parseBody( $body ) { - $body = strip_tags($body, ""); - //$body = strtr($body,"\xE2\x80\xA9","\n\n\n"); - $body = str_replace("\xE2\x80\xA9","\n",$body); - - // find the inline topic/title - if (preg_match("/^topic:(.*)/mi", $body, $title)) { + $body = strip_tags($body, ""); + $body = str_replace("\xE2\x80\xA9","\n",$body); + + // find the inline topic/title + if (preg_match("/^topic:(.*)/mi", $body, $title)) { //And put the title var in the proper place - $this->_topic = trim($title[1]); - } - // find user - if (preg_match("/^user:(.*)/mi", $body, $user)) { - $this->_user = trim($user[1]); - } - // find pass or password - if (preg_match("/^pass(?:word)?:(.*)/mi", $body, $password)) { - $this->_pass = trim($password[1]); - } - // find cat, cats, category, or categories - if (preg_match("/^cat(?:s|egor(?:y|ies)?)?:(.*)/mi", $body, $articlecategories)) { - $this->_articlecategories = explode(",", preg_replace("/^0-9,/", "", trim($articlecategories[1]))); - } - // find globalcat or globalcategory - if (preg_match("/^globalcat(?:egory)?:(.*)/mi", $body, $globalcategory)) { - $this->_globalcategory = preg_replace("/^0-9/", "", trim($globalcategory[1])); - } - // find blogid - if (preg_match("/^blogid:(.*)/mi", $body, $blog)) { - $this->_blogId = trim($blog[1]); - } - // find blog(name) - if (preg_match("/^blog:(.*)/mi", $body, $blogname)) { - $this->_blogName = trim($blogname[1]); - } + $this->_topic = trim($title[1]); + } + // find user + if (preg_match("/^user:(.*)/mi", $body, $user)) { + $this->_user = trim($user[1]); + } + // find date + if (preg_match("/^date:(.*)/mi", $body, $date)) { + $this->_date = trim($date[1]); + } + // find pass or password + if (preg_match("/^pass(?:word)?:(.*)/mi", $body, $password)) { + $this->_pass = trim($password[1]); + } + // find cat, cats, category, or categories + if (preg_match("/^cat(?:s|egor(?:y|ies)?)?:(.*)/mi", $body, $articlecategories)) { + $this->_articlecategories = explode(",", preg_replace("/^0-9,/", "", trim($articlecategories[1]))); + } + // find globalcat or globalcategory + if (preg_match("/^globalcat(?:egory)?:(.*)/mi", $body, $globalcategory)) { + $this->_globalcategory = preg_replace("/^0-9/", "", trim($globalcategory[1])); + } + // find blogid + if (preg_match("/^blogid:(.*)/mi", $body, $blog)) { + $this->_blogId = trim($blog[1]); + } + // find blog(name) + if (preg_match("/^blog:(.*)/mi", $body, $blogname)) { + $this->_blogName = trim($blogname[1]); + } - // TODO: sanitize/validate the rest of the data too + // TODO: sanitize/validate the rest of the data too - //We strip out all the lines we already used, and use what's left as the body + //We strip out all the lines we already used, and use what's left as the body + if(!empty($title)) $body = str_replace($title[0], "", $body); + if(!empty($user)) $body = str_replace($user[0], "", $body); + if(!empty($date)) + $body = str_replace($date[0], "", $body); + if(!empty($password)) $body = str_replace($password[0], "", $body); + if(!empty($blog)) $body = str_replace($blog[0], "", $body ); + if(!empty($blogname)) $body = str_replace($blogname[0], "", $body ); + if(!empty($articlecategories)) $body = str_replace($articlecategories[0], "", $body ); + if(!empty($globalcategory)) $body = str_replace($globalcategory[0], "", $body ); - // strip off a standard .sig. Properly formed .sigs start with '-- ' on a new line. - list($body, $sig) = explode("\n-- ", $body); + // strip off a standard .sig. Properly formed .sigs start with '-- ' on a new line. + list($body, $sig) = explode("\n-- ", $body); - foreach( $this->_moblog_filter_out as $str ) { - $body = str_replace( $str, '', $body ); - } + foreach( $this->_moblog_filter_out as $str ) { + $body = str_replace( $str, '', $body ); + } - $body = trim($body); - MoblogLogger::log( "parseBody ---> body = $body" ); - $this->_body .= $body; + $body = trim($body); + // replace \n with
\n + $body = preg_replace("/\n/","
\n",$body); + MoblogLogger::log( "parseBody ---> body = $body" ); + $this->_body .= $body; } /** @@ -300,6 +316,11 @@ return $this->_articlecategories; } + function getDate() + { + return $this->_date; + } + function getGlobalCategory() { return $this->_globalcategory; Modified: plugins/branches/lifetype-1.2/moblog/class/security/moblogbatchfilter.class.php =================================================================== --- plugins/branches/lifetype-1.2/moblog/class/security/moblogbatchfilter.class.php 2022-01-12 17:42:22 UTC (rev 7256) +++ plugins/branches/lifetype-1.2/moblog/class/security/moblogbatchfilter.class.php 2022-01-12 17:45:54 UTC (rev 7257) @@ -25,7 +25,7 @@ function filter() { $blogInfo = $this->_pipelineRequest->getBlogInfo(); - $config =& Config::getConfig(); + $config = Config::getConfig(); // check if this moblog batch has been enabled or disabled by siteowner $pseudoBatch = $config->getValue('plugin_moblog_pseudobatch'); @@ -63,7 +63,7 @@ $password = $config->getValue('plugin_moblog_password'); // pop3 connection and log-in - $pop3 =& new Net_POP3(); + $pop3 = new Net_POP3(); if(PEAR::isError( $ret = $pop3->connect($mailServer , $port )) ) { // if there is a match, we can quit and reject this request @@ -98,10 +98,10 @@ $config->setValue( "plugin_moblog_lastupdate", time() ); $config->save(); - $url = &new BaseRequestGenerator(); + $url = new BaseRequestGenerator(); for ($cnt = 0; $cnt < count($messages); $cnt++) { - $req = &new HTTP_Request($url->getBaseUrl(false)."/moblog.php"); + $req = new HTTP_Request($url->getBaseUrl(false)."/moblog.php"); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addPostData('message', $messages[$cnt]); $req->sendRequest(); Modified: plugins/branches/lifetype-1.2/moblog/install/moblog.php =================================================================== --- plugins/branches/lifetype-1.2/moblog/install/moblog.php 2022-01-12 17:42:22 UTC (rev 7256) +++ plugins/branches/lifetype-1.2/moblog/install/moblog.php 2022-01-12 17:45:54 UTC (rev 7257) @@ -71,6 +71,7 @@ MoblogLogger::log( "user = '".$request->getUser()."'"); // uncomment the following if you want to see passwords... :) //MoblogLogger::log( "pass = '".$request->getPassword()."'"); +MoblogLogger::log( "date = ".$request->getDate()); MoblogLogger::log( "blog id = ".$request->getBlogId()); MoblogLogger::log( "blog name = ".$request->getBlogName()); MoblogLogger::log( "topic = ".$request->getTopic()); @@ -285,7 +286,8 @@ POST_STATUS_PUBLISHED, 0 ); -$article->setDateObject( new Timestamp()); +$article->setDateObject(new Timestamp(Timestamp::parseDate($request->getDate()))); + // enable or disable comments by default depending on the current config $commentsEnabled = $blogSettings->getValue( "comments_enabled" ); $article->setCommentsEnabled( $commentsEnabled ); Modified: plugins/branches/lifetype-1.2/moblog/pluginmoblog.class.php =================================================================== --- plugins/branches/lifetype-1.2/moblog/pluginmoblog.class.php 2022-01-12 17:42:22 UTC (rev 7256) +++ plugins/branches/lifetype-1.2/moblog/pluginmoblog.class.php 2022-01-12 17:45:54 UTC (rev 7257) @@ -14,7 +14,7 @@ $this->id = "moblog"; $this->author = "The Lifetype Project"; $this->locales = Array(); - $this->version = "20111027"; + $this->version = "20200604"; $this->desc = " Send a message with the following format ('start' and 'end' messages not included!):

@@ -21,12 +21,17 @@ --- start of moblog message format ---
USER: your-lifetype-username
PASS: your-lifetype-password
-BLOG: your-lifetype-blog-name or BLOGID: id-of-your-blog
+DATE: English parseable date format (for backdating or postdating posts)
+CATEGORY: comma separated list of categories
+GLOBALCATEGORY: global article category
+BLOG: your-lifetype-blog-name or BLOGID: id-of-your-blog
TOPIC: your-subject (optional)
--- end of moblog message format ---

The subject of the mail will be used as the subject for the article as long as there is no TOPIC set.
-The message must be sent as plain text, and it can include as many attachment as needed."; +The message must be sent as plain text, and it can include as many attachment as needed.
+Allowed HTML tags: <i>,<b>,<a>,<u>,<s>
+Carriage returns will be converted to <br/> tags."; $this->init(); } From jondaley at devel.lifetype.net Wed Jan 12 12:47:44 2022 From: jondaley at devel.lifetype.net (jondaley at devel.lifetype.net) Date: Wed, 12 Jan 2022 12:47:44 -0500 Subject: [pLog-svn] r7258 - plog/branches/lifetype-1.2/class/dao Message-ID: <20220112174744.9D48CBA0001@minneola.limedaley.com> Author: jondaley Date: 2022-01-12 12:47:44 -0500 (Wed, 12 Jan 2022) New Revision: 7258 Modified: plog/branches/lifetype-1.2/class/dao/model.class.php Log: php7 updates Modified: plog/branches/lifetype-1.2/class/dao/model.class.php =================================================================== --- plog/branches/lifetype-1.2/class/dao/model.class.php 2022-01-12 17:45:54 UTC (rev 7257) +++ plog/branches/lifetype-1.2/class/dao/model.class.php 2022-01-12 17:47:44 UTC (rev 7258) @@ -330,7 +330,7 @@ * @param cacheId * @return True if successful or false if error */ - function add( &$dbObject, $cacheId = null ) + function add( $dbObject, $cacheId = null ) { $fields = $dbObject->getFieldGetters(); $fieldsString = ''; @@ -382,7 +382,7 @@ * @param dbObject * @return True if successful or false if error */ - function update( &$dbObject ) + function update( $dbObject ) { lt_include( PLOG_CLASS_PATH."class/database/db.class.php" ); @@ -487,4 +487,4 @@ } } } -?> \ No newline at end of file +?> From jondaley at devel.lifetype.net Wed Jan 12 12:48:05 2022 From: jondaley at devel.lifetype.net (jondaley at devel.lifetype.net) Date: Wed, 12 Jan 2022 12:48:05 -0500 Subject: [pLog-svn] r7259 - plog/branches/lifetype-1.2/class/data/validator Message-ID: <20220112174805.DED03BA0001@minneola.limedaley.com> Author: jondaley Date: 2022-01-12 12:48:05 -0500 (Wed, 12 Jan 2022) New Revision: 7259 Modified: plog/branches/lifetype-1.2/class/data/validator/validator.class.php Log: php7 updates Modified: plog/branches/lifetype-1.2/class/data/validator/validator.class.php =================================================================== --- plog/branches/lifetype-1.2/class/data/validator/validator.class.php 2022-01-12 17:47:44 UTC (rev 7258) +++ plog/branches/lifetype-1.2/class/data/validator/validator.class.php 2022-01-12 17:48:05 UTC (rev 7259) @@ -71,9 +71,9 @@ * * @param rule A valid Rule object */ - function addRule(&$rule) + function addRule($rule) { - $this->_rules[] = &$rule; + $this->_rules[] = $rule; } /** @@ -114,4 +114,4 @@ return true; } } -?> \ No newline at end of file +?>