Browse Source

! a little more code documentation
! Fixing and merging rev 10385, 10396 from 2.1-requests, on LogInOut.php related to [bug 4339]
! Very small optimizations in index.php (just to apaise Josh :P), merged from 2.1-requests.

Spuds 12 years ago
parent
commit
094b03363e

+ 3 - 1
Sources/Admin.php

@@ -632,7 +632,9 @@ function DisplayAdminFile()
 	list ($file_data, $filetype) = $smcFunc['db_fetch_row']($request);
 	$smcFunc['db_free_result']($request);
 
-	// !!! Temp.
+	/**
+	 * @todo Temp
+	 */
 	// Figure out if sesc is still being used.
 	if (strpos($file_data, ';sesc=') !== false)
 		$file_data = '

+ 6 - 2
Sources/DbPackages-sqlite.php

@@ -358,7 +358,9 @@ function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_e
 	// If we're here we know we don't have the index - so just add it.
 	if (!empty($index_info['type']) && $index_info['type'] == 'primary')
 	{
-		//!!! Doesn't work with PRIMARY KEY yet.
+		/**
+		 * @todo Doesn't work with PRIMARY KEY yet.
+		 */
 	}
 	else
 	{
@@ -389,7 +391,9 @@ function smf_db_remove_index($table_name, $index_name, $parameters = array(), $e
 
 	foreach ($indexes as $index)
 	{
-		//!!! Doesn't do primary key at the moment!
+		/**
+		 * @todo Doesn't do primary key at the moment!
+		 */
 		if ($index['type'] != 'primary' && $index['name'] == $index_name)
 		{
 			// Drop the bugger...

+ 3 - 1
Sources/Groups.php

@@ -517,7 +517,9 @@ function MembergroupMembers()
 			$smcFunc['db_free_result']($request);
 		}
 
-		// !!! Add $_POST['additional'] to templates!
+		/**
+		 * @todo Add $_POST['additional'] to templates!
+		 */
 
 		// Do the updates...
 		if (!empty($members))

+ 8 - 7
Sources/LogInOut.php

@@ -207,7 +207,7 @@ function Login2()
 		)
 	);
 	// Probably mistyped or their email, try it as an email address. (member_name first, though!)
-	if ($smcFunc['db_num_rows']($request) == 0)
+	if ($smcFunc['db_num_rows']($request) == 0 && strpos($_POST['user'], '@') !== false)
 	{
 		$smcFunc['db_free_result']($request);
 
@@ -221,12 +221,13 @@ function Login2()
 				'user_name' => $_POST['user'],
 			)
 		);
-		// Let them try again, it didn't match anything...
-		if ($smcFunc['db_num_rows']($request) == 0)
-		{
-			$context['login_errors'] = array($txt['username_no_exist']);
-			return;
-		}
+	}
+
+	// Let them try again, it didn't match anything...
+	if ($smcFunc['db_num_rows']($request) == 0)
+	{
+		$context['login_errors'] = array($txt['username_no_exist']);
+		return;
 	}
 
 	$user_settings = $smcFunc['db_fetch_assoc']($request);

+ 3 - 1
Sources/ManageAttachments.php

@@ -972,7 +972,9 @@ function RepairAttachments()
 				redirectexit('action=admin;area=manageattachments;sa=maintenance');
 
 			$_SESSION['attachments_to_fix'] = array();
-			//!!! No need to do this I think.
+			/**
+			 * @todo No need to do this I think.
+			 */
 			foreach ($_POST['to_fix'] as $key => $value)
 				$_SESSION['attachments_to_fix'][] = $value;
 		}

+ 1 - 1
Sources/ManageLanguages.php

@@ -847,7 +847,7 @@ function ModifyLanguage()
 	{
 		checkSession();
 
-		// !!! Todo: FTP Controls?
+		// @todo: FTP Controls?
 		require_once($sourcedir . '/Subs-Package.php');
 
 		// First, Make a backup?

+ 6 - 2
Sources/ManageMembergroups.php

@@ -329,7 +329,9 @@ function AddMembergroup()
 		$postCountBasedGroup = isset($_POST['min_posts']) && (!isset($_POST['postgroup_based']) || !empty($_POST['postgroup_based']));
 		$_POST['group_type'] = !isset($_POST['group_type']) || $_POST['group_type'] < 0 || $_POST['group_type'] > 3 || ($_POST['group_type'] == 1 && !allowedTo('admin_forum')) ? 0 : (int) $_POST['group_type'];
 
-		// !!! Check for members with same name too?
+		/**
+		 * @todo Check for members with same name too?
+		 */
 
 		$request = $smcFunc['db_query']('', '
 			SELECT MAX(id_group)
@@ -673,7 +675,9 @@ function EditMembergroup()
 		$_POST['group_hidden'] = empty($_POST['group_hidden']) || $_POST['min_posts'] != -1 || $_REQUEST['group'] == 3 ? 0 : (int) $_POST['group_hidden'];
 		$_POST['group_inherit'] = $_REQUEST['group'] > 1 && $_REQUEST['group'] != 3 && (empty($inherit_type) || $inherit_type != 1) ? (int) $_POST['group_inherit'] : -2;
 
-		// !!! Don't set online_color for the Moderators group?
+		/**
+		 * @todo Don't set online_color for the Moderators group?
+		 */
 
 		// Do the update of the membergroup settings.
 		$smcFunc['db_query']('', '

+ 3 - 1
Sources/ManageMembers.php

@@ -280,7 +280,9 @@ function ViewMemberlist()
 			'++' => '>'
 		);
 
-		// !!! Validate a little more.
+		/**
+		 * @todo Validate a little more.
+		 */
 
 		// Loop through every field of the form.
 		$query_parts = array();

+ 3 - 1
Sources/ManagePaid.php

@@ -1428,7 +1428,9 @@ function addSubscription($id_subscribe, $id_member, $renewal = 0, $forceStartTim
 			'current_member' => $id_member,
 		)
 	);
-	//!!! Don't really need to do this twice...
+	/**
+	 * @todo Don't really need to do this twice...
+	 */
 	if ($smcFunc['db_num_rows']($request) != 0)
 	{
 		list ($id_sublog, $endtime, $starttime) = $smcFunc['db_fetch_row']($request);

+ 3 - 1
Sources/ManagePosts.php

@@ -220,7 +220,9 @@ function ModifyPostSettings($return_config = false)
 
 			if (isset($body_type) && $_POST['max_messageLength'] > 65535 && $body_type == 'text')
 			{
-				// !!! Show an error message?!
+				/**
+				 * @todo Show an error message?!
+				 */
 				// MySQL only likes fulltext indexes on text columns... for now?
 				if (!empty($fulltext))
 					$_POST['max_messageLength'] = 65535;

+ 8 - 2
Sources/ManageServer.php

@@ -479,6 +479,7 @@ function prepareServerSettingsContext(&$config_vars)
 
 /**
  * Helper function, it sets up the context for database settings.
+ * @todo see rev. 10406 from 2.1-requests
  *
  * @param array $config_vars
  */
@@ -567,7 +568,9 @@ function prepareDBSettingContext(&$config_vars)
 			}
 
 			// Set the subtext in case it's part of the label.
-			// !!! Temporary. Preventing divs inside label tags.
+			/**
+			 * @todo Temporary. Preventing divs inside label tags.
+			 */
 			$divPos = strpos($context['config_vars'][$config_var[1]]['label'], '<div');
 			if ($divPos !== false)
 			{
@@ -611,7 +614,9 @@ function prepareDBSettingContext(&$config_vars)
 
 			$context['bbc_columns'][$col][] = array(
 				'tag' => $tag,
-				// !!! 'tag_' . ?
+				/**
+				 * @todo  'tag_' . ?
+				 */
 				'show_help' => isset($helptxt[$tag]),
 			);
 
@@ -731,6 +736,7 @@ function saveSettings(&$config_vars)
 
 /**
  * Helper function for saving database settings.
+ * @todo see rev. 10406 from 2.1-requests
  *
  * @param array $config_vars
  */

+ 6 - 2
Sources/ManageSettings.php

@@ -1721,7 +1721,9 @@ function EditCustomProfiles()
 				$colname = $initial_colname = 'cust_' . mt_rand(1, 999);
 
 			// Make sure this is unique.
-			// !!! This may not be the most efficient way to do this.
+			/**
+			 * @todo This may not be the most efficient way to do this.
+			 */
 			$unique = false;
 			for ($i = 0; !$unique && $i < 9; $i ++)
 			{
@@ -1801,7 +1803,9 @@ function EditCustomProfiles()
 						);
 				}
 			}
-			//!!! Maybe we should adjust based on new text length limits?
+			/**
+			 * @todo Maybe we should adjust based on new text length limits?
+			 */
 		}
 
 		// Do the insertion/updates.

+ 6 - 2
Sources/ManageSmileys.php

@@ -1376,7 +1376,9 @@ function InstallSmileySet()
 	$name = strtok(basename(isset($_FILES['set_gz']) ? $_FILES['set_gz']['name'] : $_REQUEST['set_gz']), '.');
 	$name = preg_replace(array('/\s/', '/\.[\.]+/', '/[^\w_\.\-]/'), array('_', '.', ''), $name);
 
-	// !!! Decide: overwrite or not?
+	/**
+	 * @todo Decide: overwrite or not?
+	 */
 	if (isset($_FILES['set_gz']) && is_uploaded_file($_FILES['set_gz']['tmp_name']) && (@ini_get('open_basedir') != '' || file_exists($_FILES['set_gz']['tmp_name'])))
 		$extracted = read_tgz_file($_FILES['set_gz']['tmp_name'], $boarddir . '/Smileys/' . $name);
 	elseif (isset($_REQUEST['set_gz']))
@@ -1398,7 +1400,9 @@ function InstallSmileySet()
 	cache_put_data('parsing_smileys', null, 480);
 	cache_put_data('posting_smileys', null, 480);
 
-	// !!! Add some confirmation?
+	/**
+	 * @todo Add some confirmation?
+	 */
 	redirectexit('action=admin;area=smileys');
 }
 

+ 3 - 1
Sources/Memberlist.php

@@ -501,7 +501,9 @@ function MLSearch()
 		$context['page_index'] = constructPageIndex($scripturl . '?action=mlist;sa=search;search=' . $_POST['search'] . ';fields=' . implode(',', $_POST['fields']), $_REQUEST['start'], $numResults, $modSettings['defaultMaxMembers']);
 
 		// Find the members from the database.
-		// !!!SLOW This query is slow.
+		/**
+		 * @todo SLOW This query is slow.
+		 */
 		$request = $smcFunc['db_query']('', '
 			SELECT mem.id_member
 			FROM {db_prefix}members AS mem

+ 4 - 2
Sources/MessageIndex.php

@@ -677,8 +677,10 @@ function QuickModeration()
 	}
 	else
 	{
-		// !!! Ugly.  There's no getting around this, is there?
-		// !!! Maybe just do this on the actions people want to use?
+		/**
+		 * @todo Ugly. There's no getting around this, is there?
+		 * @todo Maybe just do this on the actions people want to use?
+		 */
 		$boards_can = array(
 			'make_sticky' => boardsAllowedTo('make_sticky'),
 			'move_any' => boardsAllowedTo('move_any'),

+ 3 - 1
Sources/ModerationCenter.php

@@ -1037,7 +1037,9 @@ function ShowNotice()
 
 	loadTemplate('ModerationCenter');
 
-	//!!! Assumes nothing needs permission more than accessing moderation center!
+	/**
+	 * @todo Assumes nothing needs permission more than accessing moderation center!
+	 */
 	$id_notice = (int) $_GET['nid'];
 	$request = $smcFunc['db_query']('', '
 		SELECT body, subject

+ 14 - 30
Sources/MoveTopic.php

@@ -17,35 +17,17 @@
 if (!defined('SMF'))
 	die('Hacking attempt...');
 
-/*	This file contains the functions required to move topics from one board to
-	another board.
-
-	void MoveTopic()
-		- is called to allow moderator to give reason for topic move.
-		- must be called with a topic specified.
-		- uses the MoveTopic template and main sub template.
-		- if the member is the topic starter requires the move_own permission,
-		  otherwise the move_any permission.
-		- is accessed via ?action=movetopic.
-
-	void MoveTopic2()
-		- is called on the submit of MoveTopic.
-		- requires the use of the Subs-Post.php file.
-		- logs that topics have been moved in the moderation log.
-		- if the member is the topic starter requires the move_own permission,
-		  otherwise requires the move_any permission.
-		- upon successful completion redirects to message index.
-		- is accessed via ?action=movetopic2.
-
-	void moveTopics(array topics, int destination_board)
-		- performs the changes needed to move topics to new boards.
-		- topics is an array of the topics to move, and destination_board is
-		  where they should be moved to.
-		- updates message, topic and calendar statistics.
-		- does not check permissions. (assumes they have been checked!)
-*/
-
-// Move a topic.  Give the moderator a chance to post a reason.
+/**
+ * This function allows to move a topic, making sure to ask the moderator
+ * to give reason for topic move.
+ * It must be called with a topic specified. (that is, global $topic must
+ * be set... @todo fix this thing.)
+ * If the member is the topic starter requires the move_own permission,
+ * otherwise the move_any permission.
+ * Accessed via ?action=movetopic.
+ *
+ * @uses the MoveTopic template, main sub-template.
+ */
 function MoveTopic()
 {
 	global $txt, $board, $topic, $user_info, $context, $language, $scripturl, $settings, $smcFunc, $modSettings;
@@ -297,7 +279,9 @@ function MoveTopic2()
 	}
 
 	// Create a link to this in the old board.
-	//!!! Does this make sense if the topic was unapproved before? I'd just about say so.
+	/**
+	 * @todo Does this make sense if the topic was unapproved before? I'd just about say so.
+	 */
 	if (isset($_POST['postRedirect']))
 	{
 		// Should be in the boardwide language.

+ 6 - 3
Sources/News.php

@@ -170,7 +170,9 @@ function ShowXmlFeed()
 	// Show in rss or proprietary format?
 	$xml_format = isset($_GET['type']) && in_array($_GET['type'], array('smf', 'rss', 'rss2', 'atom', 'rdf', 'webslice')) ? $_GET['type'] : 'smf';
 
-	// !!! Birthdays?
+	/**
+	 * @todo Birthdays? 
+	 */
 
 	// List all the different types of data they can pull.
 	$subActions = array(
@@ -182,7 +184,9 @@ function ShowXmlFeed()
 	if (empty($_GET['sa']) || !isset($subActions[$_GET['sa']]))
 		$_GET['sa'] = 'recent';
 
-	//!!! Temp - webslices doesn't do everything yet.
+	/**
+	 * @todo Temp - webslices doesn't do everything yet.
+	 */
 	if ($xml_format == 'webslice' && $_GET['sa'] != 'recent')
 		$xml_format = 'rss2';
 	// If this is webslices we kinda cheat - we allow a template that we call direct for the HTML, and we override the CDATA.
@@ -412,7 +416,6 @@ function cdata_parse($data, $ns = '')
 				$cdata .= ']]>' . $smcFunc['substr']($data, $pos, $pos2 - $pos + 1) . '<![CDATA[';
 			elseif (in_array($ent, array('amp', 'lt', 'gt', 'quot')))
 				$cdata .= ']]>' . $smcFunc['substr']($data, $pos, $pos2 - $pos + 1) . '<![CDATA[';
-			// !!! ??
 
 			$pos = $pos2 + 1;
 		}

+ 6 - 2
Sources/PackageGet.php

@@ -626,7 +626,9 @@ function PackageUpload()
 	// Setup the correct template, even though I'll admit we ain't downloading ;)
 	$context['sub_template'] = 'downloaded';
 
-	// !!! TODO: Use FTP if the Packages directory is not writable.
+	/**
+	 * @todo Use FTP if the Packages directory is not writable.
+	 */
 
 	// Check the file was even sent!
 	if (!isset($_FILES['package']['name']) || $_FILES['package']['name'] == '')
@@ -645,7 +647,9 @@ function PackageUpload()
 
 	// Setup the destination and throw an error if the file is already there!
 	$destination = $boarddir . '/Packages/' . $packageName;
-	// !!! Maybe just roll it like we do for downloads?
+	/**
+	 * @todo Maybe just roll it like we do for downloads?
+	 */
 	if (file_exists($destination))
 		fatal_lang_error('package_upload_error_exists');
 

+ 24 - 8
Sources/Packages.php

@@ -66,7 +66,9 @@ function Packages()
 	// Set up some tabs...
 	$context[$context['admin_menu_name']]['tab_data'] = array(
 		'title' => $txt['package_manager'],
-		// !!! 'help' => 'registrations',
+		/**
+		 * @todo 'help' => 'registrations',
+		 */
 		'description' => $txt['package_manager_desc'],
 		'tabs' => array(
 			'browse' => array(
@@ -571,7 +573,9 @@ function PackageInstallTest()
 		if (empty($thisAction))
 			continue;
 
-		// !!! None given?
+		/**
+		 * @todo None given?
+		 */
 		$thisAction['description'] = isset($action['description']) ? $action['description'] : '';
 		$context['actions'][] = $thisAction;
 	}
@@ -682,7 +686,9 @@ function PackageInstall()
 
 	require_once($sourcedir . '/Subs-Package.php');
 
-	// !!! TODO: Perhaps do it in steps, if necessary?
+	/**
+	 * @todo Perhaps do it in steps, if necessary?
+	 */
 
 	$context['uninstalling'] = $_REQUEST['sa'] == 'uninstall2';
 
@@ -794,7 +800,9 @@ function PackageInstall()
 	if (!empty($modSettings['package_make_backups']) && (!isset($_SESSION['last_backup_for']) || $_SESSION['last_backup_for'] != $context['filename'] . ($context['uninstalling'] ? '$$' : '$')))
 	{
 		$_SESSION['last_backup_for'] = $context['filename'] . ($context['uninstalling'] ? '$$' : '$');
-		// !!! Internationalize this?
+		/**
+		 * @todo Internationalize this?
+		 */
 		package_create_backup(($context['uninstalling'] ? 'backup_' : 'before_') . strtok($context['filename'], '.'));
 	}
 
@@ -823,7 +831,9 @@ function PackageInstall()
 	$smcFunc['db_free_result']($request);
 
 	// Wait, it's not installed yet!
-	// !!! TODO: Replace with a better error message!
+	/**
+	 * @todo Replace with a better error message!
+	 */
 	if (!isset($old_version) && $context['uninstalling'])
 	{
 		deltree($boarddir . '/Packages/temp');
@@ -867,7 +877,9 @@ function PackageInstall()
 
 	$context['install_finished'] = false;
 
-	// !!! TODO: Make a log of any errors that occurred and output them?
+	/**
+	 * @todo Make a log of any errors that occurred and output them?
+	 */
 
 	if (!empty($install_log))
 	{
@@ -1671,7 +1683,9 @@ function PackagePermissions()
 		if (!is_array($modSettings['attachmentUploadDir']))
 			$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
 
-		// !!! Should we suggest non-current directories be read only?
+		/**
+		 * @todo Should we suggest non-current directories be read only?
+		 */
 		foreach ($modSettings['attachmentUploadDir'] as $dir)
 			$context['file_tree'][strtr($dir, array('\\' => '/'))] = array(
 			'type' => 'dir',
@@ -1849,7 +1863,9 @@ function fetchPerms__recursive($path, &$data, $level)
 	// Are we actually interested in saving this data?
 	$save_data = empty($context['only_find']) || $context['only_find'] == $path;
 
-	//!!! Shouldn't happen - but better error message?
+	/**
+	 * @todo Shouldn't happen - but better error message?
+	 */
 	if (!is_dir($path))
 		fatal_lang_error('no_access', false);
 

+ 28 - 9
Sources/PersonalMessage.php

@@ -49,7 +49,9 @@ function MessageMain()
 		$context['message_limit'] = 0;
 	elseif (($context['message_limit'] = cache_get_data('msgLimit:' . $user_info['id'], 360)) === null)
 	{
-		// !!! Why do we do this?  It seems like if they have any limit we should use it.
+		/**
+		 * @todo Why do we do this?  It seems like if they have any limit we should use it.
+		 */
 		$request = $smcFunc['db_query']('', '
 			SELECT MAX(max_messages) AS top_limit, MIN(max_messages) AS bottom_limit
 			FROM {db_prefix}membergroups
@@ -633,7 +635,9 @@ function MessageFolder()
 	// This is kinda simple!
 	else
 	{
-		// !!!SLOW This query uses a filesort. (inbox only.)
+		/**
+		 * @todo SLOW This query uses a filesort. (inbox only.)
+		 */
 		$request = $smcFunc['db_query']('', '
 			SELECT pm.id_pm, pm.id_pm_head, pm.id_member_from
 			FROM {db_prefix}personal_messages AS pm' . ($context['folder'] == 'sent' ? '' . ($context['sort_by'] == 'name' ? '
@@ -1060,7 +1064,10 @@ function MessageSearch2()
 	if (!empty($context['load_average']) && !empty($modSettings['loadavg_search']) && $context['load_average'] >= $modSettings['loadavg_search'])
 		fatal_lang_error('loadavg_search_disabled', false);
 
-	// !!! For the moment force the folder to the inbox.
+	/**
+	 * @todo For the moment force the folder to the inbox.
+	 * @todo Maybe set the inbox based on a cookie or theme setting?
+	 */
 	$context['folder'] = 'inbox';
 
 	// Some useful general permissions.
@@ -1129,7 +1136,9 @@ function MessageSearch2()
 		}
 
 		// Who matches those criteria?
-		// !!! This doesn't support sent item searching.
+		/**
+		 * @todo This doesn't support sent item searching.
+		 */
 		$request = $smcFunc['db_query']('', '
 			SELECT id_member
 			FROM {db_prefix}members
@@ -1159,7 +1168,9 @@ function MessageSearch2()
 	}
 
 	// Setup the sorting variables...
-	// !!! Add more in here!
+	/**
+	 * @todo Add more in here!
+	 */
 	$sort_columns = array(
 		'pm.id_pm',
 	);
@@ -1338,7 +1349,9 @@ function MessageSearch2()
 	$smcFunc['db_free_result']($request);
 
 	// Get all the matching messages... using standard search only (No caching and the like!)
-	// !!! This doesn't support sent item searching yet.
+	/**
+	 * @todo This doesn't support sent item searching yet.
+	 */
 	$request = $smcFunc['db_query']('', '
 		SELECT pm.id_pm, pm.id_pm_head, pm.id_member_from
 		FROM {db_prefix}pm_recipients AS pmr
@@ -2421,7 +2434,9 @@ function MessageActionsApply()
 		$smcFunc['db_free_result']($request);
 
 		// Any errors?
-		// !!! Separate the sprintf?
+		/**
+		 * @todo Separate the sprintf?
+		 */
 		if (!empty($updateErrors))
 			fatal_lang_error('labels_too_many', true, array($updateErrors));
 	}
@@ -3041,7 +3056,9 @@ function ReportMessage()
 	{
 		$context['sub_template'] = 'report_message';
 
-		// !!! I don't like being able to pick who to send it to.  Favoritism, etc. sucks.
+		/**
+		 * @todo I don't like being able to pick who to send it to.  Favoritism, etc. sucks.
+		 */
 		// Now, get all the administrators.
 		$request = $smcFunc['db_query']('', '
 			SELECT id_member, real_name
@@ -3431,7 +3448,9 @@ function ApplyRules($all_messages = false)
 	// Just unread ones?
 	$ruleQuery = $all_messages ? '' : ' AND pmr.is_new = 1';
 
-	//!!! Apply all should have timeout protection!
+	/**
+	 * @todo Apply all should have timeout protection!
+	 */
 	// Get all the messages that match this.
 	$request = $smcFunc['db_query']('', '
 		SELECT

+ 27 - 10
Sources/Post.php

@@ -77,7 +77,6 @@ if (!defined('SMF'))
 		- accessed with ?action=quotefast.
 
 	void JavaScriptModify()
-		// !!!
 */
 
 function Post()
@@ -197,7 +196,9 @@ function Post()
 		}
 
 		$locked = 0;
-		// !!! These won't work if you're making an event.
+		/**
+		 * @todo These won't work if you're making an event.
+		 */
 		$context['can_lock'] = allowedTo(array('lock_any', 'lock_own'));
 		$context['can_sticky'] = allowedTo('make_sticky') && !empty($modSettings['enableStickyTopics']);
 
@@ -205,7 +206,9 @@ function Post()
 		$context['sticky'] = !empty($_REQUEST['sticky']);
 	}
 
-	// !!! These won't work if you're posting an event!
+	/**
+	 * @todo These won't work if you're posting an event!
+	 */
 	$context['can_notify'] = allowedTo('mark_any_notify');
 	$context['can_move'] = allowedTo('move_any');
 	$context['move'] = !empty($_REQUEST['move']);
@@ -628,7 +631,9 @@ function Post()
 				)
 			);
 			// The message they were trying to edit was most likely deleted.
-			// !!! Change this error message?
+			/**
+			 * @todo Change this error message?
+			 */
 			if ($smcFunc['db_num_rows']($request) == 0)
 				fatal_lang_error('no_board', false);
 			$row = $smcFunc['db_fetch_assoc']($request);
@@ -731,7 +736,9 @@ function Post()
 			)
 		);
 		// The message they were trying to edit was most likely deleted.
-		// !!! Change this error message?
+		/**
+		 * @todo Change this error message?
+		 */
 		if ($smcFunc['db_num_rows']($request) == 0)
 			fatal_lang_error('no_board', false);
 		$row = $smcFunc['db_fetch_assoc']($request);
@@ -886,7 +893,9 @@ function Post()
 		}
 	}
 
-	// !!! This won't work if you're posting an event.
+	/**
+	 * This won't work if you're posting an event.
+	 */
 	if (allowedTo('post_attachment') || allowedTo('post_unapproved_attachments'))
 	{
 		if (empty($_SESSION['temp_attachments']))
@@ -1096,7 +1105,9 @@ function Post()
 		$context['linktree'][count($context['linktree']) - 1]['url'] = $scripturl . '?action=post;' . (!empty($topic) ? 'topic=' . $topic : 'board=' . $board) . '.' . $_REQUEST['start'] . (isset($_REQUEST['msg']) ? ';msg=' . (int) $_REQUEST['msg'] . ';' . $context['session_var'] . '=' . $context['session_id'] : '');
 
 	// If they've unchecked an attachment, they may still want to attach that many more files, but don't allow more than num_allowed_attachments.
-	// !!! This won't work if you're posting an event.
+	/**
+	 * @todo This won't work if you're posting an event.
+	 */
 	$context['num_allowed_attachments'] = empty($modSettings['attachmentNumPerPostLimit']) ? 50 : min($modSettings['attachmentNumPerPostLimit'] - count($context['current_attachments']) + (isset($deleted_attachments) ? $deleted_attachments : 0), $modSettings['attachmentNumPerPostLimit']);
 	$context['can_post_attachment'] = !empty($modSettings['attachmentEnable']) && $modSettings['attachmentEnable'] == 1 && (allowedTo('post_attachment') || ($modSettings['postmod_active'] && allowedTo('post_unapproved_attachments'))) && $context['num_allowed_attachments'] > 0;
 	$context['can_post_attachment_unapproved'] = allowedTo('post_attachment');
@@ -2208,7 +2219,9 @@ function AnnouncementSend()
 
 	checkSession();
 
-	// !!! Might need an interface?
+	/**
+	 * @todo Might need an interface?
+	 */
 	$chunkSize = empty($modSettings['mail_queue']) ? 50 : 500;
 
 	$context['start'] = empty($_REQUEST['start']) ? 0 : (int) $_REQUEST['start'];
@@ -2419,7 +2432,9 @@ function notifyMembersBoard(&$topicData)
 		foreach ($boards[$rowmember['id_board']] as $key)
 		{
 			// Don't notify the guy who started the topic!
-			//!!! In this case actually send them a "it's approved hooray" email
+			/**
+			 * @todo In this case actually send them a "it's approved hooray" email
+			 */
 			if ($topicData[$key]['poster'] == $rowmember['id_member'])
 				continue;
 
@@ -2614,7 +2629,9 @@ function QuoteFast()
 
 		$context['quote']['mozilla'] = strtr($smcFunc['htmlspecialchars']($context['quote']['text']), array('&quot;' => '"'));
 	}
-	// !!! Needs a nicer interface.
+	/**
+	 * @todo Needs a nicer interface.
+	 */
 	// In case our message has been removed in the meantime.
 	elseif (isset($_REQUEST['modify']))
 	{

+ 6 - 2
Sources/PostModeration.php

@@ -23,7 +23,9 @@ function PostModerationMain()
 {
 	global $sourcedir;
 
-	//!!! We'll shift these later bud.
+	/**
+	 * @todo We'll shift these later bud.
+	 */
 	loadLanguage('ModerationCenter');
 	loadTemplate('ModerationCenter');
 
@@ -59,7 +61,9 @@ function UnapprovedPosts()
 	$approve_boards = boardsAllowedTo('approve_posts');
 
 	// If we filtered by board remove ones outside of this board.
-	//!!! Put a message saying we're filtered?
+	/**
+	 * @todo Put a message saying we're filtered?
+	 */
 	if (isset($_REQUEST['brd']))
 	{
 		$filter_board = array((int) $_REQUEST['brd']);

+ 44 - 26
Sources/Profile-Actions.php

@@ -1,6 +1,8 @@
 <?php
 
 /**
+ * This file handles actions made on a user's profile.
+ *
  * Simple Machines Forum (SMF)
  *
  * @package SMF
@@ -14,25 +16,11 @@
 if (!defined('SMF'))
 	die('Hacking attempt...');
 
-/*	This file contains profile action functions.
-
-	void activateAccount(int id_member)
-		// !!!
-
-	void issueWarning(int id_member)
-		// !!!
-
-	void deleteAccount(int id_member)
-		// !!!
-
-	void deleteAccount2(array profile_variables, array &errors, int id_member)
-		// !!!
-
-	void subscriptions(int id_member)
-		// !!!
-*/
-
-// Activate an account.
+/**
+ * Activate an account.
+ *
+ * @param int $memID, the member ID
+ */
 function activateAccount($memID)
 {
 	global $sourcedir, $context, $user_profile, $modSettings;
@@ -67,7 +55,11 @@ function activateAccount($memID)
 	redirectexit('action=profile;u=' . $memID . ';area=summary');
 }
 
-// Issue/manage a users warning status.
+/**
+ * Issue/manage an user's warning status.
+ *
+ * @param int $memID
+ */
 function issueWarning($memID)
 {
 	global $txt, $scripturl, $modSettings, $user_info, $mbname;
@@ -332,7 +324,11 @@ function issueWarning($memID)
 		$context['notification_templates'][$k]['body'] = strtr($name['body'], array('{MEMBER}' => un_htmlspecialchars($context['member']['name']), '{MESSAGE}' => '[url=' . $scripturl . '?msg=' . $context['warning_for_message'] . ']' . un_htmlspecialchars($context['warned_message_subject']) . '[/url]', '{SCRIPTURL}' => $scripturl, '{FORUMNAME}' => $mbname, '{REGARDS}' => $txt['regards_team']));
 }
 
-// Get the number of warnings a user has.
+/**
+ * Get the number of warnings a user has.
+ *
+ * @param int $memID
+ */
 function list_getUserWarningCount($memID)
 {
 	global $smcFunc;
@@ -353,7 +349,14 @@ function list_getUserWarningCount($memID)
 	return $total_warnings;
 }
 
-// Get the data about a users warnings.
+/**
+ * Get the data about a users warnings.
+ *
+ * @param int $start
+ * @param int $items_per_page
+ * @param string $sort
+ * @param int $memID, the member ID
+ */
 function list_getUserWarnings($start, $items_per_page, $sort, $memID)
 {
 	global $smcFunc, $scripturl;
@@ -391,7 +394,11 @@ function list_getUserWarnings($start, $items_per_page, $sort, $memID)
 	return $previous_warnings;
 }
 
-// Present a screen to make sure the user wants to be deleted
+/**
+ * Present a screen to make sure the user wants to be deleted
+ *
+ * @param int $memID, the member ID
+ */
 function deleteAccount($memID)
 {
 	global $txt, $context, $user_info, $modSettings, $cur_profile, $smcFunc;
@@ -409,6 +416,13 @@ function deleteAccount($memID)
 	$context['page_title'] = $txt['deleteAccount'] . ': ' . $cur_profile['real_name'];
 }
 
+/**
+ * Actually delete an account.
+ *
+ * @param $profile_vars
+ * @param $post_errors
+ * @param int $memID, the member ID
+ */
 function deleteAccount2($profile_vars, $post_errors, $memID)
 {
 	global $user_info, $sourcedir, $context, $cur_profile, $modSettings, $smcFunc;
@@ -416,7 +430,7 @@ function deleteAccount2($profile_vars, $post_errors, $memID)
 	// Try get more time...
 	@set_time_limit(600);
 
-	// !!! Add a way to delete pms as well?
+	// @todo Add a way to delete pms as well?
 
 	if (!$context['user']['is_owner'])
 		isAllowedTo('profile_remove_any');
@@ -484,7 +498,7 @@ function deleteAccount2($profile_vars, $post_errors, $memID)
 				$smcFunc['db_free_result']($request);
 
 				// Actually remove the topics.
-				// !!! This needs to check permissions, but we'll let it slide for now because of moderate_forum already being had.
+				// @todo This needs to check permissions, but we'll let it slide for now because of moderate_forum already being had.
 				removeTopics($topicIDs);
 			}
 
@@ -534,7 +548,11 @@ function deleteAccount2($profile_vars, $post_errors, $memID)
 	}
 }
 
-// Function for doing all the paid subscription stuff - kinda.
+/**
+ * Function for doing all the paid subscription stuff - kinda.
+ *
+ * @param int $memID
+ */
 function subscriptions($memID)
 {
 	global $context, $txt, $sourcedir, $modSettings, $smcFunc, $scripturl;

+ 149 - 74
Sources/Profile-Modify.php

@@ -1,6 +1,10 @@
 <?php
 
 /**
+ * This file has the primary job of showing and editing people's profiles.
+ * 	It also allows the user to change some of their or another's preferences,
+ * 	and such things
+ *
  * Simple Machines Forum (SMF)
  *
  * @package SMF
@@ -10,119 +14,71 @@
  *
  * @version 2.0
  */
-
+profilevalid
 if (!defined('SMF'))
 	die('Hacking attempt...');
 
-/*	This file has the primary job of showing and editing people's profiles.
-	It also allows the user to change some of their or another's preferences,
-	and such things.  It uses the following functions:
-
-	void loadProfileFields(bool force_reload = false)
-		// !!!
-
-	void setupProfileContext(array fields)
-		// !!!
-
-	void saveProfileFields()
-		// !!!
-
-	void saveProfileChanges(array &profile_variables, array &errors, int id_member)
-		// !!!
-
-	void makeThemeChanges(int id_member, int id_theme)
-		// !!!
-
-	void makeNotificationChanges(int id_member)
-		// !!!
-
-	void makeCustomFieldChanges(int id_member, string area, bool sanitize = true)
-		// !!!
-
+/*	
 	void editBuddies(int id_member)
-		// !!!
 
 	void editIgnoreList(int id_member)
-		// !!!
 
 	void account(int id_member)
-		// !!!
 
 	void forumProfile(int id_member)
-		// !!!
 
 	void pmprefs(int id_member)
-		// !!!
-
-	array getAvatars(string directory, int level)
-		// !!!
 
 	void theme(int id_member)
-		// !!!
 
 	void authentication(int id_member, bool saving = false)
-		// !!!
 
 	void notification(int id_member)
-		// !!!
 
 	int list_getTopicNotificationCount(int memID)
-		// !!!
 
 	array list_getTopicNotifications(int start, int items_per_page, string sort, int memID)
-		// !!!
 
 	array list_getBoardNotifications(int start, int items_per_page, string sort, int memID)
-		// !!!
 
 	void loadThemeOptions(int id_member)
-		// !!!
 
 	void ignoreboards(int id_member)
-		// !!!
 
 	bool profileLoadLanguages()
-		// !!!
 
 	bool profileLoadGroups()
-		// !!!
 
 	bool profileLoadSignatureData()
-		// !!!
 
 	bool profileLoadAvatarData()
-		// !!!
 
 	bool profileSaveGroups(mixed &value)
-		// !!!
 
 	mixed profileSaveAvatarData(array &value)
-		// !!!
 
 	mixed profileValidateSignature(mixed &value)
-		// !!!
 
 	bool profileValidateEmail(string email, int id_member = none)
-		// !!!
 
 	void profileReloadUser()
-		// !!!
 
 	void profileSendActivation()
-		// !!!
 
 	void groupMembership(int id_member)
-		// !!!
 
 	mixed groupMembership2(array profile_vars, array post_erros, int id_member)
-		// !!!
 
 	Adding new fields to the profile:
 	---------------------------------------------------------------------------
 		// !!!
 */
 
-// This defines every profile field known to man.
+/**
+ * This defines every profile field known to man.
+ * 
+ * @param bool $force_reload = false
+ */
 function loadProfileFields($force_reload = false)
 {
 	global $context, $profile_fields, $txt, $scripturl, $modSettings, $user_info, $old_profile, $smcFunc, $cur_profile, $language;
@@ -778,7 +734,11 @@ function loadProfileFields($force_reload = false)
 	}
 }
 
-// Setup the context for a page load!
+/**
+ * Setup the context for a page load!
+ * 
+ * @param array $fields
+ */
 function setupProfileContext($fields)
 {
 	global $profile_fields, $context, $cur_profile, $smcFunc, $txt;
@@ -861,7 +821,9 @@ function setupProfileContext($fields)
 	unset($profile_fields);
 }
 
-// Save the profile changes.
+/**
+ * Save the profile changes.
+ */
 function saveProfileFields()
 {
 	global $profile_fields, $profile_vars, $context, $old_profile, $post_errors, $sourcedir, $modSettings, $cur_profile, $smcFunc;
@@ -994,7 +956,13 @@ function saveProfileFields()
 	unset($profile_fields);
 }
 
-// Save the profile changes....
+/**
+ * Save the profile changes
+ * 
+ * @param array &$profile_variables
+ * @param array &$post_errors
+ * @param int $memID id_member
+ */
 function saveProfileChanges(&$profile_vars, &$post_errors, $memID)
 {
 	global $user_info, $txt, $modSettings, $user_profile;
@@ -1077,7 +1045,12 @@ function saveProfileChanges(&$profile_vars, &$post_errors, $memID)
 	}
 }
 
-// Make any theme changes that are sent with the profile..
+/**
+ * Make any theme changes that are sent with the profile.
+ * 
+ * @param int $memID
+ * @param int $id_theme
+ */
 function makeThemeChanges($memID, $id_theme)
 {
 	global $modSettings, $smcFunc, $context;
@@ -1185,7 +1158,11 @@ function makeThemeChanges($memID, $id_theme)
 	}
 }
 
-// Make any notification changes that need to be made.
+/**
+ * Make any notification changes that need to be made.
+ * 
+ * @param int $memID id_member
+ */
 function makeNotificationChanges($memID)
 {
 	global $smcFunc;
@@ -1232,7 +1209,13 @@ function makeNotificationChanges($memID)
 	}
 }
 
-// Save any changes to the custom profile fields...
+/**
+ * Save any changes to the custom profile fields
+ * 
+ * @param int $memID
+ * @param string $area
+ * @param bool $sanitize = true
+ */
 function makeCustomFieldChanges($memID, $area, $sanitize = true)
 {
 	global $context, $smcFunc, $user_profile, $user_info, $modSettings;
@@ -1337,7 +1320,11 @@ function makeCustomFieldChanges($memID, $area, $sanitize = true)
 	}
 }
 
-// Show all the users buddies, as well as a add/delete interface.
+/**
+ * Show all the users buddies, as well as a add/delete interface.
+ * 
+ * @param int $memID id_member
+ */
 function editBuddyIgnoreLists($memID)
 {
 	global $sourcedir, $context, $txt, $scripturl, $modSettings, $user_profile;
@@ -1372,7 +1359,11 @@ function editBuddyIgnoreLists($memID)
 	$subActions[$context['list_area']][0]($memID);
 }
 
-// Show all the users buddies, as well as a add/delete interface.
+/**
+ * Show all the users buddies, as well as a add/delete interface.
+ * 
+ * @param int $memID id_member
+ */
 function editBuddies($memID)
 {
 	global $txt, $scripturl, $modSettings;
@@ -1479,7 +1470,11 @@ function editBuddies($memID)
 	}
 }
 
-// Allows the user to view their ignore list, as well as the option to manage members on it.
+/**
+ * Allows the user to view their ignore list, as well as the option to manage members on it.
+ * 
+ * @param int $memID id_member
+ */
 function editIgnoreList($memID)
 {
 	global $txt, $scripturl, $modSettings;
@@ -1586,6 +1581,11 @@ function editIgnoreList($memID)
 	}
 }
 
+/**
+ * @todo Needs a description
+ * 
+ * @param int $memID id_member
+ */
 function account($memID)
 {
 	global $context, $txt;
@@ -1608,6 +1608,11 @@ function account($memID)
 	);
 }
 
+/**
+ * @todo Needs a description
+ * 
+ * @param int $memID id_member
+ */
 function forumProfile($memID)
 {
 	global $context, $user_profile, $user_info, $txt, $modSettings;
@@ -1631,7 +1636,11 @@ function forumProfile($memID)
 	);
 }
 
-// Allow the edit of *someone elses* personal message settings.
+/**
+ * Allow the edit of *someone elses* personal message settings.
+ * 
+ * @param int $memID id_member
+ */
 function pmprefs($memID)
 {
 	global $sourcedir, $context, $txt, $scripturl;
@@ -1649,7 +1658,13 @@ function pmprefs($memID)
 	);
 }
 
-// Recursive function to retrieve avatar files
+/**
+ * Recursive function to retrieve avatar files
+ * 
+ * @param string $directory
+ * @param int $level
+ * @return array
+ */
 function getAvatars($directory, $level)
 {
 	global $context, $txt, $modSettings;
@@ -1726,6 +1741,11 @@ function getAvatars($directory, $level)
 	return $result;
 }
 
+/**
+ * @todo needs a description
+ * 
+ * @param int $memID id_member
+ */
 function theme($memID)
 {
 	global $txt, $context, $user_profile, $modSettings, $settings, $user_info, $smcFunc;
@@ -1746,7 +1766,12 @@ function theme($memID)
 	);
 }
 
-// Changing authentication method? Only appropriate for people using OpenID.
+/**
+ * Changing authentication method? Only appropriate for people using OpenID.
+ * 
+ * @param int $memID id_member
+ * @param bool $saving = false
+ */
 function authentication($memID, $saving = false)
 {
 	global $context, $cur_profile, $sourcedir, $txt, $post_errors, $modSettings;
@@ -1823,7 +1848,11 @@ function authentication($memID, $saving = false)
 	$context['sub_template'] = 'authentication_method';
 }
 
-// Display the notifications and settings for changes.
+/**
+ * Display the notifications and settings for changes.
+ * 
+ * @param int $memID id_member
+ */
 function notification($memID)
 {
 	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc, $sourcedir, $settings;
@@ -2033,6 +2062,11 @@ function notification($memID)
 	loadThemeOptions($memID);
 }
 
+/**
+ * @todo needs a description
+ * 
+ * @param int $memID id_member
+ */
 function list_getTopicNotificationCount($memID)
 {
 	global $smcFunc, $user_info, $context, $modSettings;
@@ -2056,6 +2090,15 @@ function list_getTopicNotificationCount($memID)
 	return $totalNotifications;
 }
 
+/**
+ * @todo Needs a description
+ * 
+ * @param int $start
+ * @param int $items_per_page
+ * @param string $sort
+ * @param int $memID id_member
+ * @return array $notification_topics
+ */
 function list_getTopicNotifications($start, $items_per_page, $sort, $memID)
 {
 	global $smcFunc, $txt, $scripturl, $user_info, $context, $modSettings;
@@ -2144,6 +2187,11 @@ function list_getBoardNotifications($start, $items_per_page, $sort, $memID)
 	return $notification_boards;
 }
 
+/**
+ * @todo needs a description
+ * 
+ * @param int $memID id_member
+ */
 function loadThemeOptions($memID)
 {
 	global $context, $options, $cur_profile, $smcFunc;
@@ -2194,6 +2242,11 @@ function loadThemeOptions($memID)
 	}
 }
 
+/**
+ * @todo needs a description
+ * 
+ * @param int $memID id_member
+ */
 function ignoreboards($memID)
 {
 	global $txt, $user_info, $context, $modSettings, $smcFunc, $cur_profile;
@@ -2269,7 +2322,10 @@ function ignoreboards($memID)
 	loadThemeOptions($memID);
 }
 
-// Load all the languages for the profile.
+/**
+ * Load all the languages for the profile.
+ * @return bool
+ */
 function profileLoadLanguages()
 {
 	global $context, $modSettings, $settings, $cur_profile, $language, $smcFunc;
@@ -2290,7 +2346,9 @@ function profileLoadLanguages()
 	return count($context['profile_languages']) > 1 ? true : false;
 }
 
-// Load all the group info for the profile.
+/**
+ * @return true
+ */
 function profileLoadGroups()
 {
 	global $cur_profile, $txt, $context, $smcFunc, $user_settings;
@@ -2343,7 +2401,11 @@ function profileLoadGroups()
 	return true;
 }
 
-// Load key signature context data.
+/**
+ * Load key signature context data.
+ * 
+ * @return true
+ */
 function profileLoadSignatureData()
 {
 	global $modSettings, $context, $txt, $cur_profile, $smcFunc;
@@ -2948,7 +3010,12 @@ function profileValidateSignature(&$value)
 	return true;
 }
 
-// Validate an email address.
+/**
+ * Validate an email address.
+ * 
+ * @param string $email
+ * @param int $memID=0
+ */
 function profileValidateEmail($email, $memID = 0)
 {
 	global $smcFunc, $context;
@@ -3048,7 +3115,11 @@ function profileSendActivation()
 	obExit();
 }
 
-// Function to allow the user to choose group membership etc...
+/**
+ * Function to allow the user to choose group membership etc...
+ * 
+ * @param int $memID id_member
+ */
 function groupMembership($memID)
 {
 	global $txt, $scripturl, $user_profile, $user_info, $context, $modSettings, $smcFunc;
@@ -3142,7 +3213,11 @@ function groupMembership($memID)
 		$context['group_request'] = $context['groups']['available'][(int) $_REQUEST['request']];
 }
 
-// This function actually makes all the group changes...
+/**
+ * This function actually makes all the group changes
+ * 
+ * 
+ */
 function groupMembership2($profile_vars, $post_errors, $memID)
 {
 	global $user_info, $sourcedir, $context, $user_profile, $modSettings, $txt, $smcFunc, $scripturl, $language;

+ 15 - 14
Sources/Profile.php

@@ -1,6 +1,10 @@
 <?php
 
 /**
+ * This file has the primary job of showing and editing people's profiles.
+ * It also allows the user to change some of their or another's preferences,
+ * and such things.
+ *
  * Simple Machines Forum (SMF)
  *
  * @package SMF
@@ -14,19 +18,11 @@
 if (!defined('SMF'))
 	die('Hacking attempt...');
 
-/*	This file has the primary job of showing and editing people's profiles.
-	It also allows the user to change some of their or another's preferences,
-	and such things.  It uses the following functions:
-
-	void ModifyProfile(array errors = none)
-		// !!!
-
-	void loadCustomFields(int id_member, string area)
-		// !!!
-
-*/
-
-// Allow the change or view of profiles...
+/**
+ * Allow the change or view of profiles...
+ *
+ * @param array $post_errors = array()
+ */
 function ModifyProfile($post_errors = array())
 {
 	global $txt, $scripturl, $user_info, $context, $sourcedir, $user_profile, $cur_profile;
@@ -645,7 +641,12 @@ function ModifyProfile($post_errors = array())
 		$context['page_title'] = $txt['profile'] . (isset($txt[$current_area]) ? ' - ' . $txt[$current_area] : '');
 }
 
-// Load any custom fields for this area... no area means load all, 'summary' loads all public ones.
+/**
+ * Load any custom fields for this area... no area means load all, 'summary' loads all public ones.
+ *
+ * @param int $memID
+ * @param string $area
+ */
 function loadCustomFields($memID, $area = 'summary')
 {
 	global $context, $txt, $user_profile, $smcFunc, $user_info, $settings, $scripturl;

+ 6 - 6
index.php

@@ -87,7 +87,7 @@ if (isset($_GET['scheduled']))
 if (!empty($modSettings['enableCompressedOutput']) && !headers_sent())
 {
 	// If zlib is being used, turn off output compression.
-	if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || @version_compare(PHP_VERSION, '4.2.0') == -1)
+	if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') === 'ob_gzhandler' || @version_compare(PHP_VERSION, '4.2.0') == -1)
 		$modSettings['enableCompressedOutput'] = '0';
 	else
 	{
@@ -135,7 +135,7 @@ if (WIRELESS)
 	$modSettings['defaultMaxTopics'] = 9;
 
 	// Wireless protocol header.
-	if (WIRELESS_PROTOCOL == 'wap')
+	if (WIRELESS_PROTOCOL === 'wap')
 		header('Content-Type: text/vnd.wap.wml');
 }
 
@@ -161,7 +161,7 @@ function smf_main()
 	global $modSettings, $settings, $user_info, $board, $topic, $board_info, $maintenance, $sourcedir;
 
 	// Special case: session keep-alive, output a transparent pixel.
-	if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
+	if (isset($_GET['action']) && $_GET['action'] === 'keepalive')
 	{
 		header('Content-Type: image/gif');
 		die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
@@ -177,7 +177,7 @@ function smf_main()
 	loadPermissions();
 
 	// Attachments don't require the entire theme to be loaded.
-	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] === 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
 		detectBrowser();
 	// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
 	else
@@ -205,10 +205,10 @@ function smf_main()
 	if (!empty($maintenance) && !allowedTo('admin_forum'))
 	{
 		// You can only login.... otherwise, you're getting the "maintenance mode" display.
-		if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'login2' || $_REQUEST['action'] == 'logout'))
+		if (isset($_REQUEST['action']) && ($_REQUEST['action'] === 'login2' || $_REQUEST['action'] === 'logout'))
 		{
 			require_once($sourcedir . '/LogInOut.php');
-			return $_REQUEST['action'] == 'login2' ? 'Login2' : 'Logout';
+			return $_REQUEST['action'] === 'login2' ? 'Login2' : 'Logout';
 		}
 		// Don't even try it, sonny.
 		else