// 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
// itemid given -> only show that item\r
$type = 'item';\r
\r
- if (!$manager->existsItem($itemid,intval($CONF['allowFuture']),intval($CONF['allowDrafts']) ) {\r
+ if (!$manager->existsItem($itemid,intval($CONF['allowFuture']),intval($CONF['allowDrafts']))) {\r
doError(_ERROR_NOSUCHITEM);\r
}\r
\r
}\r
\r
/* Return if not index.php */\r
- if ( $phppath!=strtolower($plugin_name).'/' && $phppath!=strtolower($plugin_name).'/index.php' ) {\r
+ if ( ($phppath != strtolower($plugin_name) . '/') && ($phppath != strtolower($plugin_name) . '/index.php') )\r
+ {\r
return;\r
}\r
\r
/* Exit if not logged in. */\r
- if ( !$member->isLoggedIn() ) {\r
+ if ( !$member->isLoggedIn() )\r
+ {\r
exit(_GFUNCTIONS_YOU_AERNT_LOGGEDIN);\r
}\r
\r
global $manager,$DIR_LIBS,$DIR_LANG,$HTTP_GET_VARS,$HTTP_POST_VARS;\r
\r
/* Check if this feature is needed (ie, if "$manager->checkTicket()" is not included in the script). */\r
- if (!($p_translated=serverVar('PATH_TRANSLATED'))) {\r
+ if (!($p_translated=serverVar('PATH_TRANSLATED')))\r
+ {\r
$p_translated=serverVar('SCRIPT_FILENAME');\r
}\r
if ($file=@file($p_translated))\r
$prevline='';\r
foreach($file as $line)\r
{\r
- if (preg_match('/[\$]manager([\s]*)[\-]>([\s]*)checkTicket([\s]*)[\(]/i',$prevline.$line)) {\r
+ if (preg_match('/[\$]manager([\s]*)[\-]>([\s]*)checkTicket([\s]*)[\(]/i',$prevline.$line))\r
+ {\r
return;\r
}\r
$prevline=$line;\r
if ($uri=serverVar('REQUEST_URI'))\r
{\r
list($uri,$qstring)=explode('?',$uri);\r
- } else {\r
- if ( !($uri=serverVar('PHP_SELF')) ) {\r
+ }\r
+ else\r
+ {\r
+ if ( !($uri=serverVar('PHP_SELF')) )\r
+ {\r
$uri=serverVar('SCRIPT_NAME');\r
}\r
$qstring=serverVar('QUERY_STRING');\r
}\r
- if ($qstring) {\r
+ if ($qstring)\r
+ {\r
$qstring='?'.$qstring;\r
}\r
echo '<p>'._SETTINGS_UPDATE.' : '._QMENU_PLUGINS.' <span style="color:red;">'.htmlspecialchars($plugin_name)."</span> ?</p>\n";\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