includes/functions.php
changeset 377 bb3e6c3bd4f4
parent 376 66732bd4532c
child 378 c1c7fa6b329f
--- a/includes/functions.php	Sat Jan 26 11:51:19 2008 -0500
+++ b/includes/functions.php	Sat Jan 26 15:42:32 2008 -0500
@@ -82,10 +82,16 @@
     $flags .= $sep . 'theme='.$session->theme;
     $sep = '&';
   }
-  if ( isset($_GET['style'] ) ) {
+  if ( isset($_GET['style'] ) )
+  {
     $flags .= $sep . 'style='.$session->style;
     $sep = '&';
   }
+  if ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) )
+  {
+    $flags .= $sep . 'lang=' . urlencode($_GET['lang']);
+    $sep = '&';
+  }
 
   $url = $session->append_sid(contentPath.$t.$flags);
   if($query)
@@ -133,6 +139,11 @@
     $flags .= $sep . 'style='.$session->style;
     $sep = '&';
   }
+  if ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) )
+  {
+    $flags .= $sep . 'lang=' . urlencode($_GET['lang']);
+    $sep = '&';
+  }
 
   if(defined('ENANO_BASE_CLASSES_INITIALIZED'))
   {
@@ -201,6 +212,11 @@
     $flags .= $sep . 'style='.$session->style;
     $sep = '&';
   }
+  if ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) )
+  {
+    $flags .= $sep . 'lang=' . urlencode($_GET['lang']);
+    $sep = '&';
+  }
 
   if(defined('ENANO_BASE_CLASSES_INITIALIZED'))
   {
@@ -2453,9 +2469,9 @@
   
   if ( isset($paths->nslist['User']) )
   {
-    if ( preg_match('/^' . preg_quote($paths->nslist['User']) . '/', $page_id) )
+    if ( preg_match('/^' . str_replace('/', '\\/', preg_quote($paths->nslist['User'])) . '/', $page_id) )
     {
-      $ip = preg_replace('/^' . preg_quote($paths->nslist['User']) . '/', '', $page_id);
+      $ip = preg_replace('/^' . str_replace('/', '\\/', preg_quote($paths->nslist['User'])) . '/', '', $page_id);
       if ( is_valid_ip($ip) )
       {
         return $page_id;