PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Tue Mar 13, 2007 6:42 pm Reply with quote Back to top

My days are numbered with PHP-Nuke 7.9, but I thought I would pass this along.

Regarding
Only registered users can see links on this board!
Get registered or login to the forums!
....

I am running 7.9 with the 3.2 patches. My site only runs English, no multi-lingual options, so I sledge-hammered a fix for this exploit.

I went in to mainfile.php and found this code:

Code:

if (!defined('FORUM_ADMIN')) {
    if ((isset($newlang)) AND (stristr($newlang,"."))) {
      if (file_exists("language/lang-".$newlang.".php")) {
         setcookie("lang",$newlang,time()+31536000);
         include_once("language/lang-".$newlang.".php");
         $currentlang = $newlang;
      } else {
         setcookie("lang",$language,time()+31536000);
         include_once("language/lang-".$language.".php");
         $currentlang = $language;
      }
   } elseif (isset($lang)) {
      include_once("language/lang-".$lang.".php");
      $currentlang = $lang;
   } else {
      setcookie("lang",$language,time()+31536000);
      include_once("language/lang-".$language.".php");
      $currentlang = $language;
   }
}


and changed it to this:

Code:

$currentlang = 'english'; 
if (!defined('FORUM_ADMIN')) {
   include_once('language/lang-'.$language.'.php');
   $currentlang = $language;
}


Comments?
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Mar 13, 2007 9:38 pm Reply with quote Back to top

Well that would disable the multi-language features completely. The full code the Patched files use is

Code:

if (!defined('FORUM_ADMIN')) {
   if (($multilingual == 1) AND isset($newlang) AND !stristr($newlang,".")) {
      $newlang = check_html($newlang, "nohtml");
      if (file_exists("language/lang-".$newlang.".php")) {
         setcookie("lang",$newlang,time()+31536000);
         include_once("language/lang-".$newlang.".php");
         $currentlang = $newlang;
      } else {
         setcookie("lang",$language,time()+31536000);
         include_once("language/lang-".$language.".php");
         $currentlang = $language;
      }
   } elseif (($multilingual == 1) AND isset($lang) AND !stristr($lang,".")) {
      $lang = check_html($lang, "nohtml");
      if (file_exists("language/lang-".$lang.".php")) {
         setcookie("lang",$lang,time()+31536000);
         include_once("language/lang-".$lang.".php");
         $currentlang = $lang;
      } else {
         setcookie("lang",$language,time()+31536000);
         include_once("language/lang-".$language.".php");
         $currentlang = $language;
      }
   } else {
      setcookie("lang",$language,time()+31536000);
      include_once("language/lang-".$language.".php");
      $currentlang = $language;
   }
}
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Wed Mar 14, 2007 6:50 am Reply with quote Back to top

Thanks for posting the full code. Mine was admittedly a quick hack not intended for general use.

I gather that the block that lets you switch languages is the thing that actually sets $newlang (in a _POST or _GET)?
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Mar 14, 2007 5:44 pm Reply with quote Back to top

I believe it should. At least its working in 7.8 Patched and lower
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum