diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 339b0e484..64e5b2863 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -50,7 +50,7 @@ if (!defined('WORD_LIST_OBTAINED')) switch($this->request['type']) { case 'delete'; - if ($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW))) + if ($post['post_id'] != $post['topic_first_post_id'] && $is_auth['auth_delete'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW))) { if (empty($this->request['confirmed'])) { @@ -62,14 +62,14 @@ switch($this->request['type']) } else { - $this->ajax_die(sprintf($lang['DELETE_OWN_POSTS'], strip_tags($is_auth['auth_delete_type']))); + $this->ajax_die(sprintf($lang['SORRY_AUTH_DELETE'], strip_tags($is_auth['auth_delete_type']))); } break; case 'reply'; - if(bf($userdata['user_opt'], 'user_opt', 'allow_post')) + if (bf($userdata['user_opt'], 'user_opt', 'allow_post')) { - $this->ajax_die($lang['RULES_REPLY_CANNOT']); + $this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT'])); } elseif(!$is_auth['auth_reply']) { @@ -113,6 +113,10 @@ switch($this->request['type']) case 'edit': case 'editor': + if (bf($userdata['user_opt'], 'user_opt', 'allow_post_edit')) + { + $this->ajax_die($lang['POST_EDIT_CANNOT']); + } if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) { $this->ajax_die($lang['EDIT_OWN_POSTS']); @@ -224,7 +228,7 @@ switch($this->request['type']) if (bf($userdata['user_opt'], 'user_opt', 'allow_post')) { - $this->ajax_die($lang['RULES_REPLY_CANNOT']); + $this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT'])); } elseif (!$is_auth['auth_reply']) { diff --git a/upload/ajax/view_torrent.php b/upload/ajax/view_torrent.php index 426445279..0b192847b 100644 --- a/upload/ajax/view_torrent.php +++ b/upload/ajax/view_torrent.php @@ -104,7 +104,7 @@ class torrent } array_deep($f['path'], 'clean_tor_dirname'); - $length = isset($f['length']) ? $f['length'] : 0; + $length = isset($f['length']) ? (int) $f['length'] : 0; $subdir_count = count($f['path']) - 1; if ($subdir_count > 0) @@ -145,7 +145,7 @@ class torrent { $this->multiple = false; $name = isset($info['name']) ? clean_tor_dirname($info['name']) : ''; - $length = isset($info['length']) ? $info['length'] : 0; + $length = isset($info['length']) ? (int) $info['length'] : 0; $this->files_ary['/'][] = $this->build_file_item($name, $length); natsort($this->files_ary['/']); diff --git a/upload/common.php b/upload/common.php index 846880951..d52cea0ad 100644 --- a/upload/common.php +++ b/upload/common.php @@ -1,10 +1,15 @@ $userdata['username'], 'MSG_SUBJECT' => html_entity_decode($privmsg_subject), 'SITENAME' => $bb_cfg['sitename'], - 'U_INBOX' => make_url(PM_URL ."?folder=inbox$pm&mode=read&p=". $privmsg_sent_id), + 'U_INBOX' => make_url(PM_URL . "?folder=inbox&mode=read&p=". $privmsg_sent_id), )); $emailer->send(); diff --git a/upload/templates/admin/index.tpl b/upload/templates/admin/index.tpl index 4c830b95f..0d17296d6 100644 --- a/upload/templates/admin/index.tpl +++ b/upload/templates/admin/index.tpl @@ -84,21 +84,21 @@ ajax.callback.manage_user = function(data) { {L_DATASTORE}{L_ALL_CACHE},  - {L_TEMPLATES}  + {L_TEMPLATES} {L_UPDATE}: - {L_USER_LEVELS},  - {L_INDEXER} + {L_USER_LEVELS} + {L_INDEXER} {L_SYNCHRONIZE}: {L_TOPICS},  - {L_USER_POSTS_COUNT}  + {L_USER_POSTS_COUNT} diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index a4636b8b2..34ae8f740 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -126,13 +126,12 @@ function initSpoilers(context) } function initExternalLinks(context) { - var context = context || 'body'; - if (ExternalLinks_InNewWindow) { - $("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' }); - //$("a.postLink:not([@href*='"+ window.location.hostname +"/'])", context).replaceWith('{L_LINKS_ARE_FORBIDDEN}'); - } + var context = context || 'body'; + if (ExternalLinks_InNewWindow) { + $("a.postLink:not([href*='"+ window.location.hostname +"/'])", context).attr({ target: '_blank' }); + } } -function fixPostImage ($img) +function fixPostImage($img) { var banned_image_hosts = /imagebanana|hidebehind/i; // imageshack var src = $img[0].src; @@ -171,7 +170,7 @@ function initMedia(context) } } $(document).ready(function(){ - $('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) }); + $('div.post_wrap, div.signature').each(function(){ initPostBBCode( $(this) ) }); }); @@ -185,32 +184,32 @@ var LOGGED_IN = {LOGGED_IN}; var InfoWinParams = 'HEIGHT=510,resizable=yes,WIDTH=780'; var user = { - opt_js: {USER_OPTIONS_JS}, + opt_js: {USER_OPTIONS_JS}, - set: function(opt, val, days, reload) { - this.opt_js[opt] = val; - setCookie('opt_js', $.toJSON(this.opt_js), days); - if (reload) { - window.location.reload(); - } - } + set: function(opt, val, days, reload) { + this.opt_js[opt] = val; + setCookie('opt_js', $.toJSON(this.opt_js), days); + if (reload) { + window.location.reload(); + } + } } $(document).ready(function(){ - $("div.jumpbox").html('\ - \ - \ - \ - \ - '); - $('#jumpbox-container').one('click', function(){ - $('#jumpbox-title').html('   {L_LOADING} ...  '); - var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? 'jumpbox_user.html' : 'jumpbox_guest.html'); - $(this).load(jumpbox_src); - $('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); }); - }); + $("div.jumpbox").html('\ + \ + \ + \ + \ + '); + $('#jumpbox-container').one('click', function(){ + $('#jumpbox-title').html('   {L_LOADING} ...  '); + var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? 'jumpbox_user.html' : 'jumpbox_guest.html'); + $(this).load(jumpbox_src); + $('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); }); + }); }); @@ -218,17 +217,17 @@ var ajax = new Ajax('{SITE_URL}{$bb_cfg['ajax_url']}', 'POST', 'json'); function getElText (e) { - var t = ''; - if (e.textContent !== undefined) { t = e.textContent; } else if (e.innerText !== undefined) { t = e.innerText; } else { t = jQuery(e).text(); } - return t; + var t = ''; + if (e.textContent !== undefined) { t = e.textContent; } else if (e.innerText !== undefined) { t = e.innerText; } else { t = jQuery(e).text(); } + return t; } function escHTML (txt) { return txt.replace(/ -$(document).ready(function(){ - $('.tablesorter').tablesorter(); // {debug: true} +$(document).ready(function() { + $('.tablesorter').tablesorter(); }); @@ -284,13 +283,13 @@ input[type="checkbox"] { margin-bottom: -1px; } var dev = true; function OpenInEditor ($file, $line) { - $editor_path = '{EDITOR_PATH}'; - $editor_args = '{EDITOR_ARGS}'; + $editor_path = '{EDITOR_PATH}'; + $editor_args = '{EDITOR_ARGS}'; - $url = BB_ROOT +'develop/open_editor.php'; - $url += '?prog='+ $editor_path +'&args='+ $editor_args.sprintf($file, $line); + $url = BB_ROOT +'develop/open_editor.php'; + $url += '?prog='+ $editor_path +'&args='+ $editor_args.sprintf($file, $line); - window.open($url,'','height=1,width=1,left=1,top=1,resizable=yes,scrollbars=no,toolbar=no'); + window.open($url,'','height=1,width=1,left=1,top=1,resizable=yes,scrollbars=no,toolbar=no'); } @@ -431,7 +430,7 @@ if (top != self) {