News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

loadTheme() function called for 'dlattach' action if user is not guest

Started by Nathaniel, November 09, 2009, 06:30:24 PM

Previous topic - Next topic

Nathaniel

SMF 2 RC2 only, with a clean install.

File: index.php
Line: 190

Problem: The loadTheme() function should not be called when 'dlattach' is the current action, as stated by the comment on line 179. The current logic will run that function for the 'dlattach' action as long as the user is not a guest.

Related bugtracker entry:
http://dev.simplemachines.org/mantis/view.php?id=3169

Suggested fix (code for line 190):
  if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!$user_info['is_guest'] || (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest'])))

Edit: This code works as well, takes up less space...
   if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && !(empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Norv

To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: