diff options
-rw-r--r-- | classes/classloader.php | 160 | ||||
-rw-r--r-- | classes/debug.class.php | 2 | ||||
-rw-r--r-- | classes/imagetools.class.php (renamed from classes/image_tools.class.php) | 0 | ||||
-rw-r--r-- | classes/userrank.class.php (renamed from classes/user_rank.class.php) | 0 | ||||
-rw-r--r-- | classes/util.php | 5 | ||||
-rw-r--r-- | design/privateheader.php | 59 | ||||
-rw-r--r-- | docs/CodingStandards.txt | 9 | ||||
-rw-r--r-- | sections/ajax/raw_bbcode.php | 2 | ||||
-rw-r--r-- | sections/ajax/userhistory/post_history.php | 64 | ||||
-rw-r--r-- | sections/artist/artist.php | 2 | ||||
-rw-r--r-- | sections/log/sql.php | 18 | ||||
-rw-r--r-- | sections/tools/data/user_flow.php | 28 | ||||
-rw-r--r-- | static/functions/comments.js | 10 | ||||
-rw-r--r-- | static/functions/global.js | 1 | ||||
-rw-r--r-- | static/functions/script_start.js | 6 |
15 files changed, 136 insertions, 230 deletions
diff --git a/classes/classloader.php b/classes/classloader.php index c8b7221..c0f51a1 100644 --- a/classes/classloader.php +++ b/classes/classloader.php @@ -1,131 +1,35 @@ <? +/** + * Load classes automatically when they're needed + * + * @param string $ClassName class name + */ spl_autoload_register(function ($ClassName) { - $FileName = ''; - switch ($ClassName) { - case 'Artists': - $FileName = 'artists.class'; - break; - case 'Bencode': - $FileName = 'bencode.class'; - break; - case 'BencodeDecode': - $FileName = 'bencodedecode.class'; - break; - case 'BencodeTorrent': - $FileName = 'bencodetorrent.class'; - break; - case 'Bookmarks': - $FileName = 'bookmarks.class'; - break; - case 'Collages': - $FileName = 'collages.class'; - break; - case 'Format': - $FileName = 'format.class'; - break; - case 'Forums': - $FileName = 'forums.class'; - break; - case 'Forum': - $FileName = 'forum.class'; - break; - case 'ForumView': - $FileName = 'forumsview.class'; - break; - case 'G': - $FileName = 'g.class'; - break; - case 'ImageTools': - $FileName = 'image_tools.class'; - break; - case 'Inbox': - $FileName = 'inbox.class'; - break; - case 'LastFM': - $FileName = 'lastfm.class'; - break; - case 'MASS_USER_BOOKMARKS_EDITOR': - $FileName = 'mass_user_bookmarks_editor.class'; - break; - case 'MASS_USER_TORRENTS_EDITOR': - $FileName = 'mass_user_torrents_editor.class'; - break; - case 'MASS_USER_TORRENTS_TABLE_VIEW': - $FileName = 'mass_user_torrents_table_view.class'; - break; - case 'Misc': - $FileName = 'misc.class'; - break; - case 'Permissions': - $FileName = 'permissions.class'; - break; - case 'Requests': - $FileName = 'requests.class'; - break; - case 'Rippy': - $FileName = 'rippy.class'; - break; - case 'Rules': - $FileName = 'rules.class'; - break; - case 'Sphinxql': - $FileName = 'sphinxql.class'; - break; - case 'SphinxqlQuery': - $FileName = 'sphinxqlquery.class'; - break; - case 'SphinxqlResult': - $FileName = 'sphinxqlresult.class'; - break; - case 'Tags': - $FileName = 'tags.class'; - break; - case 'TEXTAREA_PREVIEW': - $FileName = 'textarea_preview.class'; - break; - case 'Thread': - $FileName = 'thread.class'; - break; - case 'Tools': - $FileName = 'tools.class'; - break; - case 'TORRENT': - case 'BENCODE_DICT': - case 'BENCODE_LIST': - $FileName = 'torrent.class'; - break; - case 'Torrents': - $FileName = 'torrents.class'; - break; - case 'TorrentsDL': - $FileName = 'torrentsdl.class'; - break; - case 'Tracker': - $FileName = 'tracker.class'; - break; - case 'UserAgent': - $FileName = 'useragent.class'; - break; - case 'UserRank': - $FileName = 'user_rank.class'; - break; - case 'Users': - $FileName = 'users.class'; - break; - case 'View': - $FileName = 'view.class'; - break; - case 'Votes': - $FileName = 'votes.class'; - break; - case 'Wiki': - $FileName = 'wiki.class'; - break; - case 'Zip': - $FileName = 'zip.class'; - break; - default: - die("Couldn't import class $ClassName"); + $FilePath = SERVER_ROOT . '/classes/' . strtolower($ClassName) . '.class.php'; + if (!file_exists($FilePath)) { + // TODO: Rename the following classes to conform with the code guidelines + switch ($ClassName) { + case 'MASS_USER_BOOKMARKS_EDITOR': + $FileName = 'mass_user_bookmarks_editor.class'; + break; + case 'MASS_USER_TORRENTS_EDITOR': + $FileName = 'mass_user_torrents_editor.class'; + break; + case 'MASS_USER_TORRENTS_TABLE_VIEW': + $FileName = 'mass_user_torrents_table_view.class'; + break; + case 'TEXTAREA_PREVIEW': + $FileName = 'textarea_preview.class'; + break; + case 'TORRENT': + case 'BENCODE_DICT': + case 'BENCODE_LIST': + $FileName = 'torrent.class'; + break; + default: + die("Couldn't import class $ClassName"); + } + $FilePath = SERVER_ROOT . "/classes/$FileName.php"; } - require_once(SERVER_ROOT . "/classes/$FileName.php"); -});
\ No newline at end of file + require_once($FilePath); +}); diff --git a/classes/debug.class.php b/classes/debug.class.php index f10d65c..8107403 100644 --- a/classes/debug.class.php +++ b/classes/debug.class.php @@ -105,7 +105,7 @@ class DEBUG { public function log_var($Var, $VarName = false) { $BackTrace = debug_backtrace(); - $ID = uniqid(); + $ID = Users::make_secret(5); if (!$VarName) { $VarName = $ID; } diff --git a/classes/image_tools.class.php b/classes/imagetools.class.php index 87cc021..87cc021 100644 --- a/classes/image_tools.class.php +++ b/classes/imagetools.class.php diff --git a/classes/user_rank.class.php b/classes/userrank.class.php index bbf84c6..bbf84c6 100644 --- a/classes/user_rank.class.php +++ b/classes/userrank.class.php diff --git a/classes/util.php b/classes/util.php index 86c7277..a9f1e1d 100644 --- a/classes/util.php +++ b/classes/util.php @@ -24,16 +24,17 @@ if (PHP_INT_SIZE === 4) { /** * Check that some given variables (usually in _GET or _POST) are numbers * - * @param array $Base Array that's supposed to contain all keys to check + * @param array $Base array that's supposed to contain all keys to check * @param array $Keys list of keys to check * @param mixed $Error error code or string to pass to the error() function if a key isn't numeric */ function assert_numbers(&$Base, $Keys, $Error = 0) { + // make sure both arguments are arrays if (!is_array($Base) || !is_array($Keys)) { return; } foreach ($Keys as $Key) { - if (empty($Base[$Key]) || !is_number($Base[$Key])) { + if (!isset($Base[$Key]) || !is_number($Base[$Key])) { error($Error); } } diff --git a/design/privateheader.php b/design/privateheader.php index 886bc47..7af2d0c 100644 --- a/design/privateheader.php +++ b/design/privateheader.php @@ -623,25 +623,25 @@ if (!empty($Alerts) || !empty($ModBar)) { <li id="searchbar_torrents"><span class="hidden">Torrents: </span> <form class="search_form" name="torrents" action="torrents.php" method="get"> -<? if (isset($LoggedUser['SearchType']) && $LoggedUser['SearchType']) { // Advanced search ?> +<? if (isset($LoggedUser['SearchType']) && $LoggedUser['SearchType']) { // Advanced search ?> <input type="hidden" name="action" value="advanced" /> -<? } ?> +<? } ?> <input id="torrentssearch" accesskey="t" spellcheck="false" - onfocus="if (this.value == 'Torrents') this.value='';" - onblur="if (this.value == '') this.value='Torrents';" - <? if (isset($LoggedUser['SearchType']) && $LoggedUser['SearchType']) { // Advanced search ?> + onfocus="if (this.value == 'Torrents') this.value = '';" + onblur="if (this.value == '') this.value = 'Torrents';" +<? if (isset($LoggedUser['SearchType']) && $LoggedUser['SearchType']) { // Advanced search ?> value="Torrents" type="text" name="groupname" size="17" - <? } else { ?> value="Torrents" type="text" name="searchstr" +<? } else { ?> value="Torrents" type="text" name="searchstr" size="17" <? } ?> /> </form></li> <li id="searchbar_artists"><span class="hidden">Artist: </span> <form class="search_form" name="artists" action="artist.php" method="get"> - <input id="artistsearch"<? Users::has_autocomplete_enabled('search'); ?> - accesskey="a" + <input id="artistsearch"<? Users::has_autocomplete_enabled('search'); + ?> accesskey="a" spellcheck="false" autocomplete="off" - onfocus="if (this.value == 'Artists') this.value='';" - onblur="if (this.value == '') this.value='Artists';" + onfocus="if (this.value == 'Artists') this.value = '';" + onblur="if (this.value == '') this.value = 'Artists';" value="Artists" type="text" name="artistname" size="17" /> </form> </li> @@ -649,8 +649,8 @@ if (!empty($Alerts) || !empty($ModBar)) { <form class="search_form" name="requests" action="requests.php" method="get"> <input id="requestssearch" spellcheck="false" - onfocus="if (this.value == 'Requests') this.value='';" - onblur="if (this.value == '') this.value='Requests';" + onfocus="if (this.value == 'Requests') this.value = '';" + onblur="if (this.value == '') this.value = 'Requests';" value="Requests" type="text" name="search" size="17" /> </form></li> <li id="searchbar_forums"><span class="hidden">Forums: </span> @@ -658,28 +658,27 @@ if (!empty($Alerts) || !empty($ModBar)) { method="get"> <input value="search" type="hidden" name="action" /> <input id="forumssearch" - onfocus="if (this.value == 'Forums') this.value='';" - onblur="if (this.value == '') this.value='Forums';" + onfocus="if (this.value == 'Forums') this.value = '';" + onblur="if (this.value == '') this.value = 'Forums';" value="Forums" type="text" name="search" size="17" /> </form></li> - <!-- - <li id="searchbar_wiki"> - <span class="hidden">Wiki: </span> - <form class="search_form" name="wiki" action="wiki.php" method="get"> - <input type="hidden" name="action" value="search" /> - <input - onfocus="if (this.value == 'Wiki') this.value='';" - onblur="if (this.value == '') this.value='Wiki';" - value="Wiki" type="text" name="search" size="17" - /> - </form> - </li> +<!-- + <li id="searchbar_wiki"><span class="hidden">Wiki: </span> + <form class="search_form" name="wiki" action="wiki.php" method="get"> + <input type="hidden" name="action" value="search" /> + <input + onfocus="if (this.value == 'Wiki') this.value = '';" + onblur="if (this.value == '') this.value = 'Wiki';" + value="Wiki" type="text" name="search" size="17" + /> + </form> + </li> --> <li id="searchbar_log"><span class="hidden">Log: </span> <form class="search_form" name="log" action="log.php" method="get"> <input id="logsearch" - onfocus="if (this.value == 'Log') this.value='';" - onblur="if (this.value == '') this.value='Log';" value="Log" + onfocus="if (this.value == 'Log') this.value = '';" + onblur="if (this.value == '') this.value = 'Log';" value="Log" type="text" name="search" size="17" /> </form></li> <li id="searchbar_users"><span class="hidden">Users: </span> @@ -687,8 +686,8 @@ if (!empty($Alerts) || !empty($ModBar)) { method="get"> <input type="hidden" name="action" value="search" /> <input id="userssearch" - onfocus="if (this.value == 'Users') this.value='';" - onblur="if (this.value == '') this.value='Users';" value="Users" + onfocus="if (this.value == 'Users') this.value = '';" + onblur="if (this.value == '') this.value = 'Users';" value="Users" type="text" name="search" size="20" /> </form></li> </ul> diff --git a/docs/CodingStandards.txt b/docs/CodingStandards.txt index fa59a15..fabeefb 100644 --- a/docs/CodingStandards.txt +++ b/docs/CodingStandards.txt @@ -62,7 +62,7 @@ Tabs shall always be used for indentation. Files shall be encoded in ASCII. Files shall always use Unix-style line endings (LF). The program dos2unix -will take care of this for you if you have files that use Windows-style +will take care of this for you, if you have files that use Windows-style line endings (CR+LF) or old Mac-style line endings (CR). File names for PHP, CSS, and JavaScript files shall be all lowercase and @@ -78,13 +78,13 @@ at the end of the same line with a space before the brace. The astute reader will note that this is K&R style with the exception of functions. There shall be a space between a control structure statement (e.g. `if`, -`elseif`, `for`) and the following parenthesis. +`elseif` in PHP, `for`) and the following parenthesis. There shall be a space around conditional operators. When using ternary operators, spaces shall be used around the operators. -For conditional blocks, `elseif` is to be used instead of `else if`. +For PHP conditional blocks, `elseif` is to be used instead of `else if`. In loops and conditional blocks, there shall be braces even if there is only one statement. @@ -102,6 +102,9 @@ printing a variable. When declaring JavaScript variables, `var` shall always be used. +When manually type casting, whitespace should not be used between the +cast operator and the variable. + ## Code styling for CSS `property: value;` pairs shall be separated by a space, and the value diff --git a/sections/ajax/raw_bbcode.php b/sections/ajax/raw_bbcode.php index e7b29d4..abc50f7 100644 --- a/sections/ajax/raw_bbcode.php +++ b/sections/ajax/raw_bbcode.php @@ -2,7 +2,7 @@ include(SERVER_ROOT . "/sections/forums/functions.php"); -$PostID = (int) $_POST['postid']; +$PostID = (int)$_POST['postid']; if (empty($PostID)) { json_die("error", "empty postid"); diff --git a/sections/ajax/userhistory/post_history.php b/sections/ajax/userhistory/post_history.php index e180a68..6447a1b 100644 --- a/sections/ajax/userhistory/post_history.php +++ b/sections/ajax/userhistory/post_history.php @@ -45,47 +45,47 @@ $ViewingOwn = ($UserID === $LoggedUser['ID']); $ShowUnread = ($ViewingOwn && (!isset($_GET['showunread']) || !!$_GET['showunread'])); $ShowGrouped = ($ViewingOwn && (!isset($_GET['group']) || !!$_GET['group'])); if ($ShowGrouped) { - $sql = ' + $SQL = ' SELECT - SQL_CALC_FOUND_ROWS - MAX(p.ID) AS ID + SQL_CALC_FOUND_ROWS + MAX(p.ID) AS ID FROM forums_posts AS p LEFT JOIN forums_topics AS t ON t.ID = p.TopicID'; if ($ShowUnread) { - $sql.=' + $SQL .= ' LEFT JOIN forums_last_read_topics AS l ON l.TopicID = t.ID AND l.UserID = '.$LoggedUser['ID']; } - $sql .= ' + $SQL .= ' LEFT JOIN forums AS f ON f.ID = t.ForumID WHERE p.AuthorID = '.$UserID.' AND ((f.MinClassRead <= '.$LoggedUser['Class']; if (!empty($RestrictedForums)) { - $sql.=' - AND f.ID NOT IN (\''.$RestrictedForums.'\')'; + $SQL .= " + AND f.ID NOT IN ('$RestrictedForums')"; } - $sql .= ')'; + $SQL .= ')'; if (!empty($PermittedForums)) { - $sql.=' - OR f.ID IN (\''.$PermittedForums.'\')'; + $SQL .= " + OR f.ID IN ('$PermittedForums')"; } - $sql .= ')'; + $SQL .= ')'; if ($ShowUnread) { - $sql .= ' - AND ((t.IsLocked=\'0\' OR t.IsSticky=\'1\') - AND (l.PostID<t.LastPostID OR l.PostID IS NULL))'; + $SQL .= ' + AND ((t.IsLocked = \'0\' OR t.IsSticky = \'1\') + AND (l.PostID < t.LastPostID OR l.PostID IS NULL))'; } - $sql .= " + $SQL .= " GROUP BY t.ID ORDER BY p.ID DESC LIMIT $Limit"; - $PostIDs = $DB->query($sql); + $PostIDs = $DB->query($SQL); $DB->query('SELECT FOUND_ROWS()'); list($Results) = $DB->next_record(); if ($Results > $PerPage * ($Page - 1)) { $DB->set_query_id($PostIDs); $PostIDs = $DB->collect('ID'); - $sql = " + $SQL = " SELECT p.ID, p.AddedTime, @@ -108,19 +108,19 @@ if ($ShowGrouped) { LEFT JOIN forums_last_read_topics AS l ON l.UserID = $UserID AND l.TopicID = t.ID WHERE p.ID IN (".implode(',', $PostIDs).') ORDER BY p.ID DESC'; - $Posts = $DB->query($sql); + $Posts = $DB->query($SQL); } } else { - $sql = ' + $SQL = ' SELECT SQL_CALC_FOUND_ROWS'; if ($ShowGrouped) { - $sql .= ' + $SQL .= ' * FROM ( SELECT'; } - $sql .= ' + $SQL .= ' p.ID, p.AddedTime, p.Body, @@ -131,10 +131,10 @@ if ($ShowGrouped) { t.Title, t.LastPostID,'; if ($UserID === $LoggedUser['ID']) { - $sql .= ' + $SQL .= ' l.PostID AS LastRead,'; } - $sql .= " + $SQL .= " t.IsLocked, t.IsSticky FROM forums_posts as p @@ -148,39 +148,39 @@ if ($ShowGrouped) { AND ((f.MinClassRead <= ".$LoggedUser['Class']; if (!empty($RestrictedForums)) { - $sql .= " + $SQL .= " AND f.ID NOT IN ('$RestrictedForums')"; } - $sql .= ' + $SQL .= ' )'; if (!empty($PermittedForums)) { - $sql .= " + $SQL .= " OR f.ID IN ('$PermittedForums')"; } - $sql .= ' + $SQL .= ' )'; if ($ShowUnread) { - $sql .= ' + $SQL .= ' AND ((t.IsLocked = \'0\' OR t.IsSticky = \'1\') AND (l.PostID < t.LastPostID OR l.PostID IS NULL) ) '; } - $sql .= ' + $SQL .= ' ORDER BY p.ID DESC'; if ($ShowGrouped) { - $sql .= ' + $SQL .= ' ) AS sub GROUP BY TopicID ORDER BY ID DESC'; } - $sql .= " + $SQL .= " LIMIT $Limit"; - $Posts = $DB->query($sql); + $Posts = $DB->query($SQL); $DB->query('SELECT FOUND_ROWS()'); list($Results) = $DB->next_record(); diff --git a/sections/artist/artist.php b/sections/artist/artist.php index bc7f6a7..1a1e308 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -136,7 +136,7 @@ if (!empty($TorrentList)) { } // Deal with torrents without release types, which can end up here -// if they're uploaded with a non-grouping category id +// if they're uploaded with a non-grouping category ID $UnknownRT = array_search('Unknown', $ReleaseTypes); if ($UnknownRT === false) { $UnknownRT = 1025; diff --git a/sections/log/sql.php b/sections/log/sql.php index 89aa772..f9bb0cb 100644 --- a/sections/log/sql.php +++ b/sections/log/sql.php @@ -7,7 +7,7 @@ if (!empty($_GET['search'])) { $Search = false; } $Words = explode(' ', $Search); -$sql = ' +$SQL = ' SELECT SQL_CALC_FOUND_ROWS ID, @@ -15,24 +15,24 @@ $sql = ' Time FROM log '; if ($Search) { - $sql .= "WHERE Message LIKE '%"; - $sql .= implode("%' AND Message LIKE '%", $Words); - $sql .= "%' "; + $SQL .= "WHERE Message LIKE '%"; + $SQL .= implode("%' AND Message LIKE '%", $Words); + $SQL .= "%' "; } if (!check_perms('site_view_full_log')) { if ($Search) { - $sql .= ' AND '; + $SQL .= ' AND '; } else { - $sql .= ' WHERE '; + $SQL .= ' WHERE '; } - $sql .= " Time>'".time_minus(3600 * 24 * 28)."' "; + $SQL .= " Time>'".time_minus(3600 * 24 * 28)."' "; } -$sql .= " +$SQL .= " ORDER BY ID DESC LIMIT $Limit"; -$Log = $DB->query($sql); +$Log = $DB->query($SQL); $DB->query('SELECT FOUND_ROWS()'); list($NumResults) = $DB->next_record(); $TotalMatches = $NumResults; diff --git a/sections/tools/data/user_flow.php b/sections/tools/data/user_flow.php index 33bdb67..c0cda27 100644 --- a/sections/tools/data/user_flow.php +++ b/sections/tools/data/user_flow.php @@ -76,35 +76,35 @@ $RS = $DB->query(" DATE_FORMAT(JoinDate, '%Y-%m-%d') AS Date, COUNT(UserID) AS Flow FROM users_info - WHERE JoinDate != '0000-00-00 00:00:00' + WHERE JoinDate != '0000-00-00 00:00:00' GROUP BY Date ) AS j LEFT JOIN ( SELECT DATE_FORMAT(BanDate, '%Y-%m-%d') AS Date, - COUNT(UserID) AS Flow - FROM users_info - WHERE BanDate != '0000-00-00 00:00:00' - AND BanReason = '1' - GROUP BY Date + COUNT(UserID) AS Flow + FROM users_info + WHERE BanDate != '0000-00-00 00:00:00' + AND BanReason = '1' + GROUP BY Date ) AS m ON j.Date = m.Date LEFT JOIN ( SELECT DATE_FORMAT(BanDate, '%Y-%m-%d') AS Date, - COUNT(UserID) AS Flow + COUNT(UserID) AS Flow FROM users_info WHERE BanDate != '0000-00-00 00:00:00' - AND BanReason = '2' - GROUP BY Date + AND BanReason = '2' + GROUP BY Date ) AS r ON j.Date = r.Date LEFT JOIN ( SELECT DATE_FORMAT(BanDate, '%Y-%m-%d') AS Date, - COUNT(UserID) AS Flow - FROM users_info - WHERE BanDate != '0000-00-00 00:00:00' - AND BanReason = '3' - GROUP BY Date + COUNT(UserID) AS Flow + FROM users_info + WHERE BanDate != '0000-00-00 00:00:00' + AND BanReason = '3' + GROUP BY Date ) AS i ON j.Date = i.Date ORDER BY j.Date DESC LIMIT $Limit"); diff --git a/static/functions/comments.js b/static/functions/comments.js index 074053f..52ba848 100644 --- a/static/functions/comments.js +++ b/static/functions/comments.js @@ -26,14 +26,14 @@ function Quote(post, user, link) { postid = post; // check if reply_box element exists and that user is in the forums - if(!$('#reply_box').length && url.path == "forums") { + if (!$('#reply_box').length && url.path == "forums") { if ($("#quote_" + postid).text() == "Quote") { original_post = $("#content" + postid).html(); $("#quote_" + postid).text("Unquote"); $.ajax({ type : "POST", - url: "ajax.php?action=raw_bbcode", - dataType: "json", + url : "ajax.php?action=raw_bbcode", + dataType : "json", data : { "postid" : postid } @@ -65,8 +65,8 @@ function Edit_Form(post,key) { //If no edit is already going underway or a previous edit was finished, make the necessary dom changes. if (!$('#editbox' + postid).results() || $('#editbox' + postid + '.hidden').results()) { $('#reply_box').ghide(); - if (location.href.match(/torrents\.php/) || - location.href.match(/artist\.php/)) { + if (location.href.match(/torrents\.php/) + || location.href.match(/artist\.php/)) { boxWidth = "50"; } else { boxWidth = "80"; diff --git a/static/functions/global.js b/static/functions/global.js index a691f28..389c96d 100644 --- a/static/functions/global.js +++ b/static/functions/global.js @@ -141,4 +141,3 @@ function select_all(el) { textRange.select(); } } - diff --git a/static/functions/script_start.js b/static/functions/script_start.js index 8f76d0c..b6f43de 100644 --- a/static/functions/script_start.js +++ b/static/functions/script_start.js @@ -212,7 +212,7 @@ function URL() { // jQuery plugin to prevent double submission of forms jQuery.fn.preventDoubleSubmission = function() { - $(this).bind('submit',function(e){ + $(this).bind('submit', function(e){ var $form = $(this); if ($form.data('submitted') === true) { @@ -275,7 +275,7 @@ jQuery.extend(jQuery.prototype, { var classes = object.className.split(' '); var result = array_search(class_name, classes); if (result !== false) { - classes.splice(result,1); + classes.splice(result, 1); object.className = classes.join(' '); } } @@ -297,7 +297,7 @@ jQuery.extend(jQuery.prototype, { var classes = object.className.split(' '); var result = array_search(class_name, classes); if (result !== false) { - classes.splice(result,1); + classes.splice(result, 1); object.className = classes.join(' '); } else { if (object.className === '') { |