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();
$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/';
* @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
}\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
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
`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` (
('URLMode', 'normal'),
('DatabaseVersion', '350'),
('DebugVars', '0'),
- ('DefaultListSize', '10');
+ ('DefaultListSize', '10'),
+ ('AdminCSS', 'original');
CREATE TABLE `nucleus_item` (
`inumber` int(11) NOT NULL auto_increment,
$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) {
$bNeedsLogin = true;
}
- if ($bNeedsLogin) {
+ if ($bNeedsLogin)
+ {
setOldAction($action); // see ADMIN::login() (sets old action in POST vars)
$action = 'showlogin';
}
*/
/********************************************
+ * Start New for 3.62 *
+ ********************************************/
+define('_SETTINGS_ADMINCSS', 'Admin Area Style');
+
+
+/********************************************
* Start New for 3.50 *
********************************************/
define('_PLUGS_TITLE_GETPLUGINS', 'get more plugins...');
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');
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!');
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');
*/
/********************************************
+ * Start New for 3.62 *
+ ********************************************/
+define('_SETTINGS_ADMINCSS', '管理領域のスタイルシート');
+
+
+/********************************************
* Start New for 3.50 *
********************************************/
define('_PLUGS_TITLE_GETPLUGINS', 'プラグインを入手…');
\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
<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
</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
);\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
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(
'COMMENT::createLinkCode("\\1", "\\3","mailto")'
);
$body = preg_replace($replaceFrom, $replaceTo, $body);
-
+
return $body;
}
if (!$member->isLoggedIn())
{
if (strlen($comment['user'])<2)
+ {
return _ERROR_COMMENT_NOUSERNAME;
+ }
}
if ((strlen($comment['email']) != 0) && !(isValidMailAddress(trim($comment['email']) ) ) )
*/
function create($name, $realname, $password, $email, $url, $admin, $canlogin, $notes) {
if (!isValidMailAddress($email))
+ {
return _ERROR_BADMAILADDRESS;
-
+ }
if (!isValidDisplayName($name))
{
return _ERROR_BADNAME;
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
/* 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);
$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);
// 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);
// 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
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
* 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
{\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
{\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
}\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
$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
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) {
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) {
$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');
// (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'])
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'];
<?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');
$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();
*/
$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;
<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>