OSDN Git Service

Now this trunk equal 3.62 without documentation. We need to test for install and...
authorsakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sun, 9 Jan 2011 12:30:50 +0000 (12:30 +0000)
committersakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sun, 9 Jan 2011 12:30:50 +0000 (12:30 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1084 1ca29b6e-896d-4ea0-84a5-967f57386b96

21 files changed:
utf8/action.php
utf8/config.php
utf8/createaccount.php
utf8/install/index.php
utf8/install/install.sql
utf8/nucleus/index.php
utf8/nucleus/language/english.php
utf8/nucleus/language/japanese-utf8.php
utf8/nucleus/libs/ADMIN.php
utf8/nucleus/libs/COMMENT.php
utf8/nucleus/libs/COMMENTS.php
utf8/nucleus/libs/MEMBER.php
utf8/nucleus/libs/SEARCH.php
utf8/nucleus/libs/globalfunctions.php
utf8/nucleus/libs/skinie.php
utf8/nucleus/media.php
utf8/nucleus/plugins/NP_Ping.php
utf8/nucleus/plugins/ping/ping.php
utf8/nucleus/xmlrpc/api_metaweblog.inc.php
utf8/nucleus/xmlrpc/server.php
utf8/skins/atom/skinbackup.xml

index b8399df..7229e89 100755 (executable)
@@ -23,7 +23,8 @@ $CONF = array();
 require('./config.php');
 
 // common functions
-include_once($DIR_LIBS . 'ACTION.php');
+//include_once($DIR_LIBS . 'ACTION.php');
+include_libs('ACTION.php',true,false);
 
 $action = requestVar('action');
 $a =& new ACTION();
index fa8729f..86c8335 100755 (executable)
@@ -29,8 +29,9 @@ $MYSQL_DATABASE = 'databasename';
 $MYSQL_PREFIX   = '';
 // new in 3.50. first element is db handler, the second is the db driver used by the handler
 // default is $MYSQL_HANDLER = array('mysql','mysql');
-$MYSQL_HANDLER = array('mysql','mysql');
+//$MYSQL_HANDLER = array('mysql','mysql');
 //$MYSQL_HANDLER = array('pdo','mysql');
+$MYSQL_HANDLER = array('mysql','');
 
 // main nucleus directory
 $DIR_NUCLEUS = '/your/path/to/nucleus/';
index af40182..728d077 100644 (file)
  * @version $Id$\r
  */\r
 \r
-require './config.php';\r
+require_once "./config.php";\r
+//include $DIR_LIBS."ACTION.php";\r
+include_libs('ACTION.php',false,false);\r
+\r
+if (isset ($_POST['showform'])&&$_POST['showform']==1) {\r
+       $showform = 1;\r
+}\r
+else {\r
+       $showform = 0;\r
+}\r
 ?>\r
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
 <html <?php echo _HTML_XML_NAME_SPACE_AND_LANG_CODE; ?>>\r
-    <head>\r
-        <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />\r
-        <title><?php echo _CREATE_ACCOUNT_TITLE ?></title>\r
-        <style type="text/css">@import url(nucleus/styles/manual.css);</style>\r
-    </head>\r
-    <body>\r
+       <head>\r
+               <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />\r
+               <title><?php echo _CREATE_ACCOUNT_TITLE ?></title>\r
+               <style type="text/css">@import url(nucleus/styles/manual.css);</style>\r
+       </head>\r
+       <body>\r
 \r
-        <h1><?php echo _CREATE_ACCOUNT0; ?></h1>\r
+       <h1><?php echo _CREATE_ACCOUNT0; ?></h1>\r
 <?php\r
 // show form only if Visitors are allowed to create a Member Account\r
 if ($CONF['AllowMemberCreate']==1) { \r
-    if (isset($_POST['showform']) && $_POST['showform'] == 1) {\r
-        include $DIR_LIBS . 'ACTION.php';\r
-        // after the from is sent it will be validated\r
-        // POST data will be added as value to treat the user with care (;-))\r
-        $a = new ACTION();\r
-        // if createAccount fails it returns an error message \r
-        $message = '<span style="font-weight:bold; color:red;">' . htmlspecialchars($a->createAccount()) . '</span><br /><br />';\r
-        if (isset($_POST['name']))\r
-            $name     = 'value="' . htmlspecialchars($_POST['name']) . '" ';\r
-        if (isset($_POST['realname']))\r
-            $realname = 'value="' . htmlspecialchars($_POST['realname']) . '" ';\r
-        if (isset($_POST['email']))\r
-            $email    = 'value="' . htmlspecialchars($_POST['email']) . '" ';\r
-        if (isset($_POST['url']))\r
-            $url      = 'value="' . htmlspecialchars($_POST['url']) . '" ';\r
+       if (isset($_POST['showform']) && $_POST['showform'] == 1) {\r
+               include $DIR_LIBS . 'ACTION.php';\r
+               // after the from is sent it will be validated\r
+               // POST data will be added as value to treat the user with care (;-))\r
+               $a = new ACTION();\r
+               // if createAccount fails it returns an error message \r
+               $message = '<span style="font-weight:bold; color:red;">' . htmlspecialchars($a->createAccount()) . '</span><br /><br />';\r
+               if (isset($_POST['name']))\r
+                       $name    = 'value="' . htmlspecialchars($_POST['name']) . '" ';\r
+               if (isset($_POST['realname']))\r
+                       $realname = 'value="' . htmlspecialchars($_POST['realname']) . '" ';\r
+               if (isset($_POST['email']))\r
+                       $email  = 'value="' . htmlspecialchars($_POST['email']) . '" ';\r
+               if (isset($_POST['url']))\r
+                       $url      = 'value="' . htmlspecialchars($_POST['url']) . '" ';\r
 //             $showform = 1;\r
 //     } else {\r
 //             $showform = 0;\r
-        echo $message;\r
-    }\r
+               echo $message;\r
+       }\r
 ?>\r
-        <form method="post" action="createaccount.php">\r
-            <div>\r
-                <input type="hidden" name="showform" value="1" />\r
-                <input type="hidden" name="action" value="createaccount" />\r
-                <?php echo _CREATE_ACCOUNT_LOGIN_NAME; ?>\r
-                <br />\r
-                <input name="name" size="32" maxlength="32" <?php echo $name; ?>/> <small><?php echo _CREATE_ACCOUNT_LOGIN_NAME_VALID; ?></small>\r
-                <br />\r
-                <br />\r
-                <?php echo _CREATE_ACCOUNT_REAL_NAME; ?>\r
-                <br />\r
-                <input name="realname" size="40" <?php echo $realname; ?>/>\r
-                <br />\r
-                <br />\r
-                <?php echo _CREATE_ACCOUNT_EMAIL; ?>\r
-                <br />\r
-                <input name="email" size="40" <?php echo $email; ?>/> <small><?php echo _CREATE_ACCOUNT_EMAIL2; ?></small>\r
-                <br />\r
-                <br />\r
-                <?php echo _CREATE_ACCOUNT_URL; ?>\r
-                <br />\r
-                <input name="url" size="60" <?php echo $url; ?>/>\r
-                <br />\r
+               <form method="post" action="createaccount.php">\r
+                       <div>\r
+                               <input type="hidden" name="showform" value="1" />\r
+                               <input type="hidden" name="action" value="createaccount" />\r
+                               <?php echo _CREATE_ACCOUNT_LOGIN_NAME; ?>\r
+                               <br />\r
+                               <input name="name" size="32" maxlength="32" <?php echo $name; ?>/> <small><?php echo _CREATE_ACCOUNT_LOGIN_NAME_VALID; ?></small>\r
+                               <br />\r
+                               <br />\r
+                               <?php echo _CREATE_ACCOUNT_REAL_NAME; ?>\r
+                               <br />\r
+                               <input name="realname" size="40" <?php echo $realname; ?>/>\r
+                               <br />\r
+                               <br />\r
+                               <?php echo _CREATE_ACCOUNT_EMAIL; ?>\r
+                               <br />\r
+                               <input name="email" size="40" <?php echo $email; ?>/> <small><?php echo _CREATE_ACCOUNT_EMAIL2; ?></small>\r
+                               <br />\r
+                               <br />\r
+                               <?php echo _CREATE_ACCOUNT_URL; ?>\r
+                               <br />\r
+                               <input name="url" size="60" <?php echo $url; ?>/>\r
+                               <br />\r
 <?php\r
-        global $manager;\r
-        // add extra fields from Plugins, like NP_Profile\r
-        $data = array(\r
-            'type'      => 'createaccount.php',\r
-            'prelabel'  => '',\r
-            'postlabel' => '<br />',\r
-            'prefield'  => '',\r
-            'postfield' => '<br /><br />'\r
-        );\r
-        $manager->notify('RegistrationFormExtraFields', $data);\r
-        // add a Captcha challenge or something else\r
-        $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));\r
+               global $manager;\r
+               // add extra fields from Plugins, like NP_Profile\r
+               $data = array(\r
+                       'type'    => 'createaccount.php',\r
+                       'prelabel'  => '',\r
+                       'postlabel' => '<br />',\r
+                       'prefield'  => '',\r
+                       'postfield' => '<br /><br />'\r
+               );\r
+               $manager->notify('RegistrationFormExtraFields', $data);\r
+               // add a Captcha challenge or something else\r
+               $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));\r
 ?>\r
-                <br />\r
-                <br />\r
-                <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT; ?>" />\r
-            </div>\r
-        </form>\r
+                               <br />\r
+                               <br />\r
+                               <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT; ?>" />\r
+                       </div>\r
+               </form>\r
 <?php\r
-} else {\r
-    echo _CREATE_ACCOUNT1;\r
-    echo _CREATE_ACCOUNT2;\r
+       }       // close else showform ...\r
+}\r
+else {\r
+       echo _CREATE_ACCOUNT1;\r
+       echo _CREATE_ACCOUNT2;\r
 }\r
 ?>\r
-    </body>\r
+</body>\r
 </html>\r
index a76b644..810c121 100755 (executable)
@@ -78,6 +78,7 @@ if (phpversion() >= '4.1.0') {
 }\r
 \r
 // include core classes that are needed for login & plugin handling\r
+include_once('../nucleus/libs/mysql.php');\r
 // added for 3.5 sql_* wrapper\r
 global $MYSQL_HANDLER;\r
 //set the handler if different from mysql (or mysqli)\r
@@ -85,10 +86,8 @@ global $MYSQL_HANDLER;
 if (!isset($MYSQL_HANDLER)) {\r
        $MYSQL_HANDLER = array('mysql','');\r
 }\r
-\r
 include_once('../nucleus/libs/sql/'.$MYSQL_HANDLER[0].'.php');\r
 // end new for 3.5 sql_* wrapper\r
-include_once('../nucleus/libs/mysql.php');\r
 \r
 // check if mysql support is installed\r
 // this check may not make sense, as is, in a version past 3.5x\r
index bf2fbf8..b853974 100755 (executable)
@@ -88,7 +88,8 @@ CREATE TABLE `nucleus_comment` (
   `cblog`   int(11)      NOT NULL default '0',
   PRIMARY KEY  (`cnumber`),
   KEY `citem` (`citem`),
-  FULLTEXT KEY `cbody` (`cbody`)
+  FULLTEXT KEY `cbody` (`cbody`),
+  INDEX `cblog` (`cblog`)
 ) TYPE=MyISAM;
 
 CREATE TABLE `nucleus_config` (
@@ -131,7 +132,8 @@ INSERT INTO `nucleus_config` (`name`, `value`) VALUES
     ('URLMode',           'normal'),
     ('DatabaseVersion',   '350'),
     ('DebugVars',         '0'),
-    ('DefaultListSize',   '10');
+    ('DefaultListSize',   '10'),
+    ('AdminCSS',          'original');
 
 CREATE TABLE `nucleus_item` (
   `inumber`   int(11)      NOT NULL auto_increment,
index a496456..62a750b 100755 (executable)
        $CONF['UsingAdminArea'] = 1;
 
        // include the admin code
-       include('../config.php');
+       require_once('../config.php');
 
-       if ($CONF['alertOnSecurityRisk'] == 1) {
+       if ($CONF['alertOnSecurityRisk'] == 1)
+       {
                // check if files exist and generate an error if so
                $aFiles = array(
                 '../install' => _ERRORS_INSTALLDIR,
                        'convert'        => _ERRORS_CONVERTDIR\r
                );
                $aFound = array();
-               foreach($aFiles as $fileName => $fileDesc) {
+               foreach($aFiles as $fileName => $fileDesc)
+               {
                        if (@file_exists($fileName))
                                array_push($aFound, $fileDesc);
                }
                if (@is_writable('../config.php')) {
                        array_push($aFound, _ERRORS_CONFIGPHP);
                }
-               if (sizeof($aFound) > 0) {
+               if (sizeof($aFound) > 0)
+               {
                        startUpError(
                                _ERRORS_STARTUPERROR1. implode($aFound, '</li><li>')._ERRORS_STARTUPERROR2,\r
                                _ERRORS_STARTUPERROR3\r
        $bNeedsLogin   = false;
        $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
 
-       if ($action == 'logout') {
+       if ($action == 'logout')
                $bNeedsLogin = true;\r
-       }
 
-       if (!$member->isLoggedIn() && !$bIsActivation) {
+       if (!$member->isLoggedIn() && !$bIsActivation)
                $bNeedsLogin = true;\r
-       }
 
        // show error if member cannot login to admin
        if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) {
@@ -62,7 +63,8 @@
                $bNeedsLogin = true;
        }
 
-       if ($bNeedsLogin) {
+       if ($bNeedsLogin)
+       {
                setOldAction($action);  // see ADMIN::login() (sets old action in POST vars)
                $action = 'showlogin';
        }
index 0f68d21..1b59ef8 100755 (executable)
  */
 
 /********************************************
+ *        Start New for 3.62                *
+ ********************************************/
+define('_SETTINGS_ADMINCSS',           'Admin Area Style');
+
+
+/********************************************
  *        Start New for 3.50                *
  ********************************************/
 define('_PLUGS_TITLE_GETPLUGINS',              'get more plugins...');
@@ -73,7 +79,7 @@ define('_LIST_ITEM_COMMENTS',                                         '%d Comments');
 define('_EDITC_URL',                                                           'Web site');
 define('_EDITC_EMAIL',                                                         'E-mail');
 
-define('_MANAGER_PLUGINFILE_NOTFOUND',                         'Plugin %s was not loaded (File not found)');
+define('_MANAGER_PLUGINFILE_NOTFOUND',                         "Plugin %s was not loaded (File not found)");
 /* changed */
 // plugin dependency
 define('_ERROR_INSREQPLUGIN',                                          'Plugin installation failed, requires %s');
@@ -412,15 +418,15 @@ define('_ACTIONLOG_ACTIVATIONLINK',                               'Activation link sent');
 define('_MSG_ACTIVATION_SENT',                                         'An activation link has been sent by e-mail.');
 
 // activation link emails
-define('_ACTIVATE_REGISTER_MAIL',                                      "Hi <%memberName%>,\n\nYou need to activate your account at <%siteName%> (<%siteUrl%>).\nYou can do this by visiting the link below: \n\n\t<%activationUrl%>\n\nYou have 2 days to do this. After this, the activation link becomes invalid.");
+define('_ACTIVATE_REGISTER_MAIL',                                      "Hi <%memberName%>,\n\nYou need to activate your account at <%siteName%> (<%siteUrl%>).\nYou can do this by visiting the link below: \n\n\t<%activationUrl%>\n\nYou have <%activationDays%> days to do this. After this, the activation link becomes invalid.");
 define('_ACTIVATE_REGISTER_MAILTITLE',                         "Activate your '<%memberName%>' account");
 define('_ACTIVATE_REGISTER_TITLE',                                     'Welcome <%memberName%>');
 define('_ACTIVATE_REGISTER_TEXT',                                      'You\'re almost there. Please choose a password for your account below.');
-define('_ACTIVATE_FORGOT_MAIL',                                                "Hi <%memberName%>,\n\nUsing the link below, you can choose a new password for your account at <%siteName%> (<%siteUrl%>) by choosing a new password.\n\n\t<%activationUrl%>\n\nYou have 2 days to do this. After this, the activation link becomes invalid.");
+define('_ACTIVATE_FORGOT_MAIL',                                                "Hi <%memberName%>,\n\nUsing the link below, you can choose a new password for your account at <%siteName%> (<%siteUrl%>) by choosing a new password.\n\n\t<%activationUrl%>\n\nYou have <%activationDays%> days to do this. After this, the activation link becomes invalid.");
 define('_ACTIVATE_FORGOT_MAILTITLE',                           "Re-activate your '<%memberName%>' account");
 define('_ACTIVATE_FORGOT_TITLE',                                       'Welcome <%memberName%>');
 define('_ACTIVATE_FORGOT_TEXT',                                                'You can choose a new password for your account below:');
-define('_ACTIVATE_CHANGE_MAIL',                                                "Hi <%memberName%>,\n\nSince your e-mail address has changed, you'll need to re-activate your account at <%siteName%> (<%siteUrl%>).\nYou can do this by visiting the link below: \n\n\t<%activationUrl%>\n\nYou have 2 days to do this. After this, the activation link becomes invalid.");
+define('_ACTIVATE_CHANGE_MAIL',                                                "Hi <%memberName%>,\n\nSince your e-mail address has changed, you'll need to re-activate your account at <%siteName%> (<%siteUrl%>).\nYou can do this by visiting the link below: \n\n\t<%activationUrl%>\n\nYou have <%activationDays%> days to do this. After this, the activation link becomes invalid.");
 define('_ACTIVATE_CHANGE_MAILTITLE',                           "Re-activate your '<%memberName%>' account");
 define('_ACTIVATE_CHANGE_TITLE',                                       'Welcome <%memberName%>');
 define('_ACTIVATE_CHANGE_TEXT',                                                'Your address change has been verified. Thanks!');
@@ -1192,7 +1198,7 @@ define('_MEMBERS_REALNAME',                                                       'Real Name');
 define('_MEMBERS_PWD',                                                         'Password');
 define('_MEMBERS_REPPWD',                                                      'Repeat Password');
 define('_MEMBERS_EMAIL',                                                       'Email address');
-define('_MEMBERS_EMAIL_EDIT',                                          '(When you change the email address, an activation link will be automatically sent out to that address)');
+define('_MEMBERS_EMAIL_EDIT',                                          '(When you change the email address, a new password will be automatically sent out to that address)');
 define('_MEMBERS_URL',                                                         'Website Address (URL)');
 define('_MEMBERS_SUPERADMIN',                                          'Administrator privileges');
 define('_MEMBERS_CANLOGIN',                                                    'Can login to admin area');
index e5255f8..f1e75b6 100755 (executable)
  */
 
 /********************************************
+ *        Start New for 3.62                *
+ ********************************************/
+define('_SETTINGS_ADMINCSS',           '管理領域のスタイルシート');
+
+
+/********************************************
  *        Start New for 3.50                *
  ********************************************/
 define('_PLUGS_TITLE_GETPLUGINS',              'プラグインを入手…');
index 5f09cf9..e91befc 100755 (executable)
@@ -1472,7 +1472,7 @@ class ADMIN {
                \r
                // replaced eregi_replace() below with preg_replace(). ereg* functions are deprecated in PHP 5.3.0\r
                /* original eregi_replace: eregi_replace("<a href=['\"]([^'\"]+)['\"]( rel=\"nofollow\")?>[^<]*</a>", "\\1", $comment['body']) */\r
-               $comment['body'] = preg_replace("#<a href=['\"]([^'\"]+)['\"]( rel=\"nofollow\")?>[^<]*</a>#I", "\\1", $comment['body']);\r
+               $comment['body'] = preg_replace("#<a href=['\"]([^'\"]+)['\"]( rel=\"nofollow\")?>[^<]*</a>#i", "\\1", $comment['body']);\r
                \r
                $this->pagehead();\r
 \r
@@ -4834,6 +4834,33 @@ selector();
                                <input name="DefaultListSize" tabindex="10079" size="40" value="<?php echo  htmlspecialchars((intval($CONF['DefaultListSize']) < 1 ? '10' : $CONF['DefaultListSize'])) ?>" />\r
                        </td>\r
                </tr><tr>\r
+                       <td><?php echo _SETTINGS_ADMINCSS?> \r
+                       </td>\r
+                       <td>\r
+                               <select name="AdminCSS" tabindex="10080">\r
+                               <?php           // show a dropdown list of all available admin css files\r
+                                       global $DIR_NUCLEUS;\r
+                                       $dirhandle = opendir($DIR_NUCLEUS."styles/");\r
+                               while ($filename = readdir($dirhandle) )\r
+                               {\r
+                                       # replaced ereg() below with preg_match(). ereg* functions are deprecated in PHP 5.3.0\r
+                                       # original ereg: ereg("^(.*)\.php$",$filename,$matches)\r
+                                       if (preg_match('#^admin_(.*)\.css$#', $filename, $matches) )\r
+                                       {\r
+                                               $name = $matches[1];\r
+                                               echo "<option value=\"$name\"";\r
+                                               if ($name == $CONF['AdminCSS'])\r
+                                               {\r
+                                                       echo " selected=\"selected\"";\r
+                                               }\r
+                                               echo ">$name</option>";\r
+                                       }\r
+                               }\r
+                               closedir($dirhandle);\r
+                               ?>\r
+                               </select>\r
+                       </td>\r
+               </tr><tr>\r
                        <th colspan="2"><?php echo _SETTINGS_MEDIA?> <?php help('media'); ?></th>\r
                </tr><tr>\r
                        <td><?php echo _SETTINGS_MEDIADIR?></td>\r
@@ -4850,7 +4877,7 @@ selector();
                </tr><tr>\r
                        <td><?php echo _SETTINGS_MEDIAURL?></td>\r
                        <td>\r
-                               <input name="MediaURL" tabindex="10080" size="40" value="<?php echo  htmlspecialchars($CONF['MediaURL']) ?>" />\r
+                               <input name="MediaURL" tabindex="10090" size="40" value="<?php echo  htmlspecialchars($CONF['MediaURL']) ?>" />\r
                        </td>\r
                </tr><tr>\r
                        <td><?php echo _SETTINGS_ALLOWUPLOAD?></td>\r
@@ -5204,7 +5231,12 @@ selector();
                );\r
 \r
                $baseUrl = htmlspecialchars($CONF['AdminURL']);\r
-\r
+               if (!array_key_exists('AdminCSS',$CONF)) \r
+               {\r
+                       sql_query("INSERT INTO ".sql_table('config')." VALUES ('AdminCSS', 'original')");\r
+                       $CONF['AdminCSS'] = 'original';\r
+               }\r
+               \r
                ?>\r
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
                <html <?php echo _HTML_XML_NAME_SPACE_AND_LANG_CODE; ?>>\r
index 6bdd43f..36de7e7 100755 (executable)
@@ -71,19 +71,23 @@ class COMMENT {
        function prepareBody($body) {
                # replaced ereg_replace() below with preg_replace(). ereg* functions are deprecated in PHP 5.3.0
                # original ereg_replace: ereg_replace("\n.\n.\n", "\n", $body);
-               // remove newlines when too many in a row               
+               
+               // convert Windows and Mac style 'returns' to *nix newlines
                $body = preg_replace("/\r\n/", "\n", $body);
-               $body = preg_replace("/\n+/", "\n", $body);
+               $body = preg_replace("/\r/", "\n", $body);
+               
+               // then remove newlines when too many in a row (3 or more newlines get converted to 1 newline)
+               $body = preg_replace("/\n{3,}/", "\n\n", $body);
                
                // encode special characters as entities
                $body = htmlspecialchars($body);
-
+               
                // trim away whitespace and newlines at beginning and end
                $body = trim($body);
-
+               
                // add <br /> tags
                $body = addBreaks($body);
-
+               
                // create hyperlinks for http:// addresses
                // there's a testcase for this in /build/testcases/urllinking.txt
                $replaceFrom = array(
@@ -99,7 +103,7 @@ class COMMENT {
                        'COMMENT::createLinkCode("\\1", "\\3","mailto")'
                );
                $body = preg_replace($replaceFrom, $replaceTo, $body);
-
+               
                return $body;
        }
 
index eb7fa97..7bf5552 100755 (executable)
@@ -339,7 +339,9 @@ class COMMENTS {
                if (!$member->isLoggedIn())
                {
                        if (strlen($comment['user'])<2)
+                       {
                                return _ERROR_COMMENT_NOUSERNAME;
+                       }
                }
                
                if ((strlen($comment['email']) != 0) && !(isValidMailAddress(trim($comment['email']) ) ) )
index 5ed9bd6..a381bca 100755 (executable)
@@ -613,8 +613,9 @@ class MEMBER {
         */
        function create($name, $realname, $password, $email, $url, $admin, $canlogin, $notes) {
                if (!isValidMailAddress($email))
+               {
                        return _ERROR_BADMAILADDRESS;
-
+               }
                if (!isValidDisplayName($name))
                {
                        return _ERROR_BADNAME;
index baad7a2..fea865a 100755 (executable)
@@ -94,7 +94,7 @@ class SEARCH {
 
        function boolean_inclusive_atoms($string) {
                $result = trim($string);
-               $result = preg_replace("/([[:space:]]{2,})/", ' ', $result);
+               $result = preg_replace("#([[:space:]]{2,})#", ' ', $result);
                
                # replaced eregi_replace() below with preg_replace(). ereg* functions are deprecated in PHP 5.3.0
                # just added delimiters to regex and the 'i' for case-insensitive matching
@@ -112,7 +112,7 @@ class SEARCH {
                
                /* strip exlusive atoms */
                $result = preg_replace(
-                       "(\-\(([A-Za-z0-9]|$this->two|$this->three){1,}([A-Za-z0-9\-\.\_\,]|$this->two|$this->three){0,}\))",
+                       "#\-\(([A-Za-z0-9]|$this->two|$this->three){1,}([A-Za-z0-9\-\.\_\,]|$this->two|$this->three){0,}\)#",
                        '',
                        $result);
                
@@ -155,10 +155,12 @@ class SEARCH {
                $result=trim($string);
                $result=preg_replace("/([[:space:]]{2,})/",' ',$result);
 
-               // convert normal boolean operators to shortened syntax
-               $result=eregi_replace(' not ',' -',$result);
-               $result=eregi_replace(' and ',' ',$result);
-               $result=eregi_replace(' or ',',',$result);
+               # replaced eregi_replace() below with preg_replace(). ereg* functions are deprecated in PHP 5.3.0
+               # just added delimiters to regex and the 'i' for case-insensitive matching
+
+               $result = preg_replace('# not #i', ' -', $result);
+               $result = preg_replace('# and #i', ' ', $result);
+               $result = preg_replace('# or #i', ',', $result);
 
                // strip excessive whitespace
                $result=str_replace('( ','(',$result);
@@ -170,12 +172,13 @@ class SEARCH {
 
                // remove double spaces (we might have introduced some new ones above)
                $result=trim($result);
-               $result=preg_replace("/([[:space:]]{2,})/",' ',$result);
+               $result=preg_replace("#([[:space:]]{2,})#",' ',$result);
 
                // apply arbitrary function to all 'word' atoms
 
-               $result_a = explode(" ",$result);
-               for($word=0;$word<count($result_a);$word++){
+               $result_a = explode(' ',$result);
+               for($word=0;$word<count($result_a);$word++)
+               {
                        $result_a[$word] = "foo[('".$result_a[$word]."')]bar";
                }
                $result = implode(" ",$result_a);
index 59804a5..6f7ddbb 100755 (executable)
@@ -20,7 +20,7 @@
 // needed if we include globalfunctions from install.php\r
 global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member;\r
 \r
-$nucleus['version'] = 'v3.61';\r
+$nucleus['version'] = 'v3.62';\r
 $nucleus['codename'] = '';\r
 \r
 // check and die if someone is trying to override internal globals (when register_globals turn on)\r
@@ -268,8 +268,15 @@ if ($action == 'login') {
                ACTIONLOG::add(INFO, "Login successful for $login (sharedpc=$shared)");\r
        } else {\r
                // errormessage for [%errordiv%]\r
-               $errormessage = 'Login failed for ' . $login;\r
-\r
+               $trimlogin = trim($login);\r
+               if (empty($trimlogin))\r
+               {\r
+                       $errormessage = "Please enter a username.";\r
+               }\r
+               else \r
+               {\r
+                       $errormessage = 'Login failed for ' . $login;\r
+               } \r
                $manager->notify('LoginFailed', array('username' => $login) );\r
                ACTIONLOG::add(INFO, $errormessage);\r
        }\r
@@ -557,7 +564,7 @@ function intCookieVar($name) {
   * returns the currently used version (100 = 1.00, 101 = 1.01, etc...)\r
   */\r
 function getNucleusVersion() {\r
-       return 361;\r
+       return 362;\r
 }\r
 \r
 /**\r
@@ -725,21 +732,21 @@ function highlight($text, $expression, $highlight) {
        {\r
                return $text;\r
        }\r
-\r
+       \r
        if (is_array($expression) && (count($expression) == 0) )\r
        {\r
                return $text;\r
        }\r
-\r
+       \r
        // add a tag in front (is needed for preg_match_all to work correct)\r
        $text = '<!--h-->' . $text;\r
-\r
+       \r
        // split the HTML up so we have HTML tags\r
        // $matches[0][i] = HTML + text\r
        // $matches[1][i] = HTML\r
        // $matches[2][i] = text\r
        preg_match_all('/(<[^>]+>)([^<>]*)/', $text, $matches);\r
-\r
+       \r
        // throw it all together again while applying the highlight to the text pieces\r
        $result = '';\r
        $count_matches = count($matches[2]);\r
@@ -748,25 +755,27 @@ function highlight($text, $expression, $highlight) {
                {\r
                        $result .= $matches[1][$i];\r
                }\r
-\r
+               \r
                if (is_array($expression) )\r
                {\r
                        foreach ($expression as $regex)\r
                        {\r
                                if ($regex)\r
                                {\r
-                                       $matches[2][$i] = @eregi_replace($regex, $highlight, $matches[2][$i]);\r
+                                       //$matches[2][$i] = @eregi_replace($regex, $highlight, $matches[2][$i]);\r
+                                       $matches[2][$i] = @preg_replace("#".$regex."#i", $highlight, $matches[2][$i]);\r
                                }\r
                        }\r
-\r
+                       \r
                        $result .= $matches[2][$i];\r
                }\r
                else\r
                {\r
-                       $result .= @eregi_replace($expression, $highlight, $matches[2][$i]);\r
+                       //$result .= @eregi_replace($expression, $highlight, $matches[2][$i]);\r
+                       $result .= @preg_replace("#".$expression."#i", $highlight, $matches[2][$i]);\r
                }\r
        }\r
-\r
+       \r
        return $result;\r
 }\r
 \r
@@ -2006,7 +2015,8 @@ function ticketForPlugin(){
                }\r
                else\r
                {\r
-                       if ( !($uri=serverVar('PHP_SELF')) ) {\r
+                       if ( !($uri=serverVar('PHP_SELF')) )\r
+                       {\r
                                $uri=serverVar('SCRIPT_NAME');\r
                        }\r
                        $qstring=serverVar('QUERY_STRING');\r
@@ -2363,12 +2373,12 @@ function cleanFileName($str) {
        $cleaner[] = array('expression'=>"/[ç]/",'replace'=>"c");\r
        \r
        $str = strtolower($str);\r
-       $ext_point = strripos($str,".");\r
+       $ext_point = strrpos($str,".");\r
        if ($ext_point===false) return false;\r
        $ext = substr($str,$ext_point,strlen($str));\r
        $str = substr($str,0,$ext_point);\r
        \r
-       foreach( $cleaner as $cv ) $str = preg_replace($cv["expression"],$cv["replace"],$str);\r
+       //foreach( $cleaner as $cv ) $str = preg_replace($cv["expression"],$cv["replace"],$str);\r
        \r
        return preg_replace("/[^a-z0-9-]/","_",$str).$ext;\r
 }\r
index 227c309..99c15cb 100755 (executable)
@@ -565,7 +565,7 @@ class SKINEXPORT {
                                if (strtoupper(_CHARSET) != 'UTF-8') {
                                        $skinName = mb_convert_encoding($skinName, 'UTF-8', _CHARSET);
                                }
-                               echo "\t\t" . '<skin name="' . $skinName . '" />' . "\n";
+                               echo "\t\t" . '<skin name="' . htmlspecialchars($skinName, ENT_QUOTES) . '" />' . "\n";
                        }
                        // templates
                        foreach ($this->templates as $templateId => $templateName) {
@@ -573,7 +573,7 @@ class SKINEXPORT {
                                if (strtoupper(_CHARSET) != 'UTF-8') {
                                        $templateName = mb_convert_encoding($templateName, 'UTF-8', _CHARSET);
                                }
-                               echo "\t\t" . '<template name="' . $templateName . '" />' . "\n";
+                               echo "\t\t" . '<template name="' . htmlspecialchars($templateName, ENT_QUOTES) . '" />' . "\n";
                        }
                        // extra info
                        if ($this->info) {
index 3af9930..ff2cc2a 100755 (executable)
@@ -34,8 +34,10 @@ $CONF = array();
 $CONF['MediaPerPage'] = 10;
 
 // include all classes and config data
-require('../config.php');
-include($DIR_LIBS . 'MEDIA.php');      // media classes
+$DIR_LIBS = '';
+require_once('../config.php');
+//include($DIR_LIBS . 'MEDIA.php');    // media classes
+include_libs('MEDIA.php',false,false);
 
 sendContentType('application/xhtml+xml', 'media');
 
@@ -331,20 +333,23 @@ function media_upload() {
                        // (see http://www.php.net/manual/en/features.file-upload.errors.php)
                        media_doError(_ERROR_BADREQUEST . ' (' . $fileerror . ')');
        }
-
+       
        if ($filesize > $CONF['MaxUploadSize'])
                media_doError(_ERROR_FILE_TOO_BIG);
-
+       
        // check file type against allowed types
        $ok = 0;
        $allowedtypes = explode (',', $CONF['AllowedTypes']);
        foreach ( $allowedtypes as $type )
-               if (eregi("\." .$type. "$",$filename)) $ok = 1;
+       {
+               //if (eregi("\." .$type. "$",$filename)) $ok = 1;
+               if (preg_match("#\." .$type. "$#i",$filename)) $ok = 1;
+       }
        if (!$ok) media_doError(_ERROR_BADFILETYPE);
-
+       
        if (!is_uploaded_file($filetempname))
                media_doError(_ERROR_BADREQUEST);
-
+       
        // prefix filename with current date (YYYY-MM-DD-)
        // this to avoid nameclashes
        if ($CONF['MediaPrefix'])
index 91f0bdc..9d9a7c0 100644 (file)
@@ -181,8 +181,7 @@ class NP_Ping extends NucleusPlugin
     function sendPings($data) {
 
         if (!class_exists('xmlrpcmsg')) {
-            global $DIR_LIBS;
-            include($DIR_LIBS . 'xmlrpc.inc.php');
+            include_libs('xmlrpc.inc.php');
         }
         $this->myBlogId = $data['blogid'];
 
index 63da95a..84ede3d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 require(dirname(__FILE__).'/../../../config.php');
 
-include($DIR_LIBS . 'PLUGINADMIN.php');
+include_libs('PLUGINADMIN.php');
 
 // create a object of the plugin via Plugin Admin
 $oPluginAdmin = new PluginAdmin('Ping');
index c8afcf2..6b9a167 100755 (executable)
                $ok = 0;
                $allowedtypes = explode (',', $CONF['AllowedTypes']);
                foreach ( $allowedtypes as $type )
-                       if (eregi("\." .$type. "$",$filename)) $ok = 1;
+               {
+                       //if (eregi("\." .$type. "$",$filename)) $ok = 1;
+                       if (preg_match("#\." .$type. "$#i",$filename)) $ok = 1;
+               }
                if (!$ok)
                        _error(8, 'Filetype is not allowed');
 
                // - add file to media library
-               include_once($DIR_LIBS . 'MEDIA.php');  // media classes
+               //include_once($DIR_LIBS . 'MEDIA.php');        // media classes
+               include_libs('MEDIA.php',true,false);
 
                // always use private media library of member
                $collection = $mem->getID();
index 6c80f72..0266c09 100755 (executable)
  */
 $CONF = array();
 require("../../config.php");   // include Nucleus libs and code
-include($DIR_LIBS . "xmlrpc.inc.php");
-include($DIR_LIBS . "xmlrpcs.inc.php");
+//include($DIR_LIBS . "xmlrpc.inc.php");
+//include($DIR_LIBS . "xmlrpcs.inc.php");
+include_libs('xmlrpc.inc.php',false,false);
+include_libs('xmlrpcs.inc.php',false,false);
 
 /* define xmlrpc settings */
 $xmlrpc_internalencoding = _CHARSET;
index e73aea5..24972b1 100755 (executable)
@@ -45,9 +45,9 @@
  <content type="html"><![CDATA[<%body%><%more%>]]]]><![CDATA[></content>
  <id><%blogurl%>:<%blogid%>:<%itemid%></id>
 </entry>]]></part>
+               <part name="POPUP_CODE"><![CDATA[<%media%>]]></part>
                <part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
                <part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
-               <part name="POPUP_CODE"><![CDATA[<%media%>]]></part>
        </template>
 
 </nucleusskin>