Skip to content

Commit 8c4202d

Browse files
committed
Misc fixes
1 parent f284e62 commit 8c4202d

11 files changed

+31
-15
lines changed

adminzone/pages/modules/admin_permissions.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ function set_keys_access()
549549
$title=get_page_title('PAGE_MATCH_KEY_ACCESS');
550550

551551
// Delete to cleanup
552-
$GLOBALS['SITE_DB']->query('DELETE FROM '.$GLOBALS['SITE_DB']->get_table_prefix().'group_page_access WHERE page_name LIKE \''.db_encode_like('%:%').'\'');
552+
$GLOBALS['SITE_DB']->query('DELETE FROM '.$GLOBALS['SITE_DB']->get_table_prefix().'group_page_access WHERE '.db_string_equal_to('zone_name','/'));
553553
$mkeylang=collapse_2d_complexity('id','k_message',$GLOBALS['SITE_DB']->query_select('match_key_messages',array('id','k_message')));
554554
$GLOBALS['SITE_DB']->query_delete('match_key_messages');
555555

@@ -568,6 +568,7 @@ function set_keys_access()
568568
{
569569
if (post_param_integer('p_'.substr($key,4).'__'.strval($gid),0)==1)
570570
{
571+
$GLOBALS['SITE_DB']->query_delete('group_page_access',array('zone_name'=>'/','page_name'=>$val,'group_id'=>$gid),'',1);
571572
$GLOBALS['SITE_DB']->query_insert('group_page_access',array('zone_name'=>'/','page_name'=>$val,'group_id'=>$gid));
572573
}
573574
}

code_editor.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,10 @@ function do_page($given_password,$path)
559559
$ftp_success=@ftp_fput($conn,$save_path,$h,FTP_BINARY);
560560
if ($ftp_success===false)
561561
{
562+
$message=addslashes(@strval($php_errormsg));
562563
echo <<<END
563564
<script language="Javascript" type="text/javascript">
564-
var msg='Could not save via FTP ['.@strval($php_errormsg).'].';
565+
var msg='Could not save via FTP [{$message}].';
565566
if (window.alert!==null)
566567
{
567568
window.alert(msg);
@@ -624,9 +625,9 @@ function do_page($given_password,$path)
624625
ce_sync_file($save_path.'.editfrom');
625626

626627
if (!isset($_POST['delete']))
627-
$message="Saved ".code_editor_escape_html($save_path)." (and if applicable, placed a backup in its directory)!";
628+
$message="Saved ".addslashes(code_editor_escape_html($save_path))." (and if applicable, placed a backup in its directory)!";
628629
else
629-
$message="Deleted ".code_editor_escape_html($save_path).". You may edit to recreate the file if you wish however.";
630+
$message="Deleted ".addslashes(code_editor_escape_html($save_path)).". You may edit to recreate the file if you wish however.";
630631
echo <<<END
631632
<script language="Javascript" type="text/javascript">
632633
var msg='{$message}';

sources/notifications.php

+4
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,10 @@ function _all_members_who_have_enabled($only_if_enabled_on__notification_code,$o
983983
$test=$GLOBALS['SITE_DB']->query_value_null_ok('notification_lockdown','l_setting',array(
984984
'l_notification_code'=>substr($only_if_enabled_on__notification_code,0,80),
985985
));
986+
if ($test === 0)
987+
{
988+
return array(array(),false);
989+
}
986990
if ((!is_null($test)) && (get_forum_type()=='ocf'))
987991
{
988992
$query_stub='SELECT m.id AS l_member_id,'.strval($test).' AS l_setting FROM '.$db->get_table_prefix().'f_members m WHERE '.str_replace('l_member_id','id',$clause_3);

sources/ocf_groups.php

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function ocf_nice_get_usergroups($it=NULL)
6363
function get_first_default_group()
6464
{
6565
$default_groups=ocf_get_all_default_groups(true);
66+
if (count($default_groups)==0) $default_groups=array(db_get_first_id()+8);
6667
return array_pop($default_groups);
6768
}
6869

sources/ocf_ldap.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function ocp_ldap_escape($str,$for_dn=false)
6262

6363
$ret=str_replace($meta_chars,$quoted_meta_chars,$str);
6464
require_code('character_sets');
65-
return convert_to_internal_encoding($ret,get_charset(),'utf8');
65+
return convert_to_internal_encoding($ret,get_charset(),'utf-8');
6666
}
6767

6868
/**
@@ -74,7 +74,7 @@ function ocp_ldap_escape($str,$for_dn=false)
7474
function ldap_unescape($str)
7575
{
7676
require_code('character_sets');
77-
return convert_to_internal_encoding($str,'utf8',get_charset());
77+
return convert_to_internal_encoding($str,'utf-8',get_charset());
7878
}
7979

8080
/**

sources/ocf_posts_action.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ function ocf_force_update_member_post_count($member_id,$member_post_count_dif=NU
404404
*/
405405
function ocf_decache_ocp_blocks($updated_forum_id,$forum_name=NULL,$member=NULL)
406406
{
407-
if (is_null($forum_name)) $forum_name=$GLOBALS['FORUM_DB']->query_value('f_forums','f_name',array('id'=>$updated_forum_id));
407+
if (is_null($forum_name)) $forum_name=$GLOBALS['FORUM_DB']->query_value_null_ok('f_forums','f_name',array('id'=>$updated_forum_id));
408408
decache('main_forum_news');
409409
decache('main_forum_topics');
410410
decache('side_forum_news');
411-
decache('bottom_news',array($forum_name));
411+
decache('bottom_news',($forum_name===NULL)?NULL:array($forum_name));
412412
if (!is_null($member))
413413
{
414414
decache('side_ocf_personal_topics',array($member));

sources/ocf_posts_action3.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,14 @@ function ocf_delete_posts_topic($topic_id,$posts,$reason)
238238
}
239239

240240
// Update member post counts
241-
$post_counts=is_null($forum_id)?1:$GLOBALS['FORUM_DB']->query_value('f_forums','f_post_count_increment',array('id'=>$forum_id));
241+
if (is_null($forum_id))
242+
{
243+
$post_counts=1;
244+
} else
245+
{
246+
$post_counts=$GLOBALS['FORUM_DB']->query_value_null_ok('f_forums','f_post_count_increment',array('id'=>$forum_id));
247+
if ($post_counts===null) $post_counts=1;
248+
}
242249
if ($post_counts==1)
243250
{
244251
$sql='SELECT p_poster FROM '.$GLOBALS['FORUM_DB']->get_table_prefix().'f_posts WHERE ('.$or_list.')';

sources/ocf_topics_action2.php

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ function ocf_delete_topic($topic_id,$reason='',$post_target_topic_id=NULL)
159159
{
160160
// Update member post counts if we've switched between post-count countable forums
161161
$post_count_info=$GLOBALS['FORUM_DB']->query('SELECT id,f_post_count_increment FROM '.$GLOBALS['FORUM_DB']->get_table_prefix().'f_forums WHERE id='.strval((integer)$forum_id).(!is_null($post_target_topic_id)?(' OR id='.strval((integer)$to)):''),2);
162+
if (!array_key_exists(0,$post_count_info))
163+
$post_count_info=array(array('id'=>$forum_id,'f_post_count_increment'=>1));
162164
if ($post_count_info[0]['id']==$forum_id)
163165
{
164166
$from_cnt=$post_count_info[0]['f_post_count_increment'];

themes/default/templates/BLOCK_HELPER_DONE.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div{$?,{$VALUE_OPTION,html5}, aria-busy="true"} class="spaced">
22
<div class="ajax_tree_list_loading">
3-
<img id="loading_image" class="inline_image_2" src="{$IMG*,bottom/loading}" title="{!LOADING^;}" alt="{!LOADING^;}" />
3+
<img class="inline_image_2" src="{$IMG*,bottom/loading}" title="{!LOADING^;}" alt="{!LOADING^;}" />
44
{!LOADING}
55
</div>
66
</div>

themes/default/templates/ERRORLOG_SCREEN.tpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
{ERROR}
66

7-
<h2>{!ERRORS_IN_PERMISSIONS_LOG}</h2>
7+
{+START,IF_NON_EMPTY,{PERMISSION}}
8+
<h2>{!ERRORS_IN_PERMISSIONS_LOG}</h2>
89

9-
<p>{!FULL_PERMISSION_LIST_SEE_FILE}</p>
10+
<p>{!FULL_PERMISSION_LIST_SEE_FILE}</p>
1011

11-
{+START,IF_NON_EMPTY,{PERMISSION}}
1212
<div class="permissions_failed">{PERMISSION*}</div>
1313
{+END}

themes/default/templates/OCF_MEMBER_PROFILE_ABOUT.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
{+START,IF_NON_EMPTY,{ACTIONS_contact}{$GET,messenger_fields}}
4040
<div>
4141
<h3>
42-
<a class="hide_button" href="#" onclick="event.returnValue=false; hideTag(this.parentNode.parentNode); return false;"><img alt="{!CONTRACT}: {!CONTACT}" title="{!CONTRACT}" src="{$IMG*,contract}" /></a>
43-
<a class="non_link" href="#" onclick="event.returnValue=false; hideTag(this.parentNode.parentNode); return false;">{!CONTACT}</a>
42+
<a class="hide_button" href="#" onclick="event.returnValue=false; hideTag(this.parentNode.parentNode); return false;"><img alt="{!CONTRACT}: {!menus:CONTACT}" title="{!CONTRACT}" src="{$IMG*,contract}" /></a>
43+
<a class="non_link" href="#" onclick="event.returnValue=false; hideTag(this.parentNode.parentNode); return false;">{!menus:CONTACT}</a>
4444
</h3>
4545

4646
<{$?,{$VALUE_OPTION,html5},nav,div} class="hide_tag" style="display: block"{$?,{$VALUE_OPTION,html5}, role="navigation"}>

0 commit comments

Comments
 (0)