wpForo Forum - Version 1.9.5

Version Description

Download this release

Release Info

Developer Tomdever
Plugin Icon 128x128 wpForo Forum
Version 1.9.5
Comparing to
See all releases

Code changes from version 1.9.4 to 1.9.5

readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: forum, forums, forum plugin, WordPress forum plugin, community, discussion
4
  Requires at least: 4.1
5
  Tested up to: 5.6
6
- Stable tag: 1.9.4
7
  Requires PHP: 5.6 and higher
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -165,10 +165,15 @@ Find wpForo forum plugin addons on [gVectors Team website...](https://gvectors.c
165
 
166
  == Changelog ==
167
 
168
- = wpForo Forum 1.9.4 | 05.02.2021 =
169
 
170
  [wpForo Forum v1.9.4 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-9-4-is-released/)
171
 
 
 
 
 
 
172
  * Added: Option to control toolbar location on topic/post editor (top/bottom)
173
  * Added: Hook to enable multi-site signup functions for forum registration
174
  * Added: Hook to control image auto-embedding in posts
3
  Tags: forum, forums, forum plugin, WordPress forum plugin, community, discussion
4
  Requires at least: 4.1
5
  Tested up to: 5.6
6
+ Stable tag: 1.9.5
7
  Requires PHP: 5.6 and higher
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
165
 
166
  == Changelog ==
167
 
168
+ = wpForo Forum 1.9.4 / 1.9.5 | 25.02.2021 =
169
 
170
  [wpForo Forum v1.9.4 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-9-4-is-released/)
171
 
172
+ * version 1.9.5
173
+ * Fixed Bug: Forum slugs are changed on forum editing
174
+ * Fixed Bug: Some small bugs are fixed
175
+ * -----
176
+ * version 1.9.4
177
  * Added: Option to control toolbar location on topic/post editor (top/bottom)
178
  * Added: Hook to enable multi-site signup functions for forum registration
179
  * Added: Hook to control image auto-embedding in posts
wpf-includes/class-forms.php CHANGED
@@ -534,7 +534,7 @@ class wpForoForm{
534
  */
535
  public function field_checkbox($f){
536
  $i = 0; $field_html = '';
537
- $f['value'] = $this->build_array_value( $f['value'] );
538
  if( !is_array($f['values']) ) $f['values'] = $this->build_array_using_string_rows( $f['values'] );
539
  if( !empty($f['values']) ){
540
  $item_field_name = $f['fieldName'] . '[]';
@@ -566,7 +566,7 @@ class wpForoForm{
566
  */
567
  public function field_radio($f){
568
  $i = 0; $field_html = '';
569
- $f['value'] = $this->build_array_value( $f['value'] );
570
  if( !is_array($f['values']) ) $f['values'] = $this->build_array_using_string_rows( $f['values'] );
571
  $use_default_selected = (trim($f['isRequired']) && !$f['value']);
572
  if( !empty($f['values']) ){
@@ -595,7 +595,7 @@ class wpForoForm{
595
  */
596
  public function field_select($f){
597
  $field_html = '';
598
- $f['value'] = $this->build_array_value( $f['value'] );
599
  if( !is_array($f['values']) ) $f['values'] = $this->build_array_using_string_rows( $f['values'] );
600
  $use_default_selected = (trim($f['isRequired']) && !$f['value']);
601
  if( !empty($f['values']) ){
534
  */
535
  public function field_checkbox($f){
536
  $i = 0; $field_html = '';
537
+ $f['value'] = $this->build_array_value( $f['value'], "\n" );
538
  if( !is_array($f['values']) ) $f['values'] = $this->build_array_using_string_rows( $f['values'] );
539
  if( !empty($f['values']) ){
540
  $item_field_name = $f['fieldName'] . '[]';
566
  */
567
  public function field_radio($f){
568
  $i = 0; $field_html = '';
569
+ $f['value'] = $this->build_array_value( $f['value'], "\n" );
570
  if( !is_array($f['values']) ) $f['values'] = $this->build_array_using_string_rows( $f['values'] );
571
  $use_default_selected = (trim($f['isRequired']) && !$f['value']);
572
  if( !empty($f['values']) ){
595
  */
596
  public function field_select($f){
597
  $field_html = '';
598
+ $f['value'] = $this->build_array_value( $f['value'], "\n" );
599
  if( !is_array($f['values']) ) $f['values'] = $this->build_array_using_string_rows( $f['values'] );
600
  $use_default_selected = (trim($f['isRequired']) && !$f['value']);
601
  if( !empty($f['values']) ){
wpf-includes/class-forums.php CHANGED
@@ -113,8 +113,7 @@ class wpForoForum{
113
  $parent_slug = WPF()->db->get_var("SELECT `slug` FROM ".WPF()->tables->forums." WHERE `forumid` = " . intval($parentid) );
114
  $new_slug = $parent_slug . "-" . wpforo_text($slug, 250, false);
115
  }else{
116
- $new_slug = wpforo_text($slug, 250, false) . '-' . $i;
117
- $i++;
118
  }
119
  }
120
  return $new_slug;
@@ -235,7 +234,7 @@ class wpForoForum{
235
  if( $args['forumid'] === $args['parentid'] ) $args['parentid'] = (int) $forum['parentid'];
236
 
237
  $args['slug'] = ($ss = trim(sanitize_title(wpfval($args, 'slug')))) ? $ss : ( ($st = trim(sanitize_title($args['title']))) ? $st : md5(time()) );
238
- $args['slug'] = $this->unique_slug($args['slug'], $args['parentid']);
239
 
240
  $args['description'] = wpforo_kses( stripslashes( wpfval($args, 'description') ) );
241
 
113
  $parent_slug = WPF()->db->get_var("SELECT `slug` FROM ".WPF()->tables->forums." WHERE `forumid` = " . intval($parentid) );
114
  $new_slug = $parent_slug . "-" . wpforo_text($slug, 250, false);
115
  }else{
116
+ $new_slug = wpforo_text($slug, 250, false) . '-' . $i++;
 
117
  }
118
  }
119
  return $new_slug;
234
  if( $args['forumid'] === $args['parentid'] ) $args['parentid'] = (int) $forum['parentid'];
235
 
236
  $args['slug'] = ($ss = trim(sanitize_title(wpfval($args, 'slug')))) ? $ss : ( ($st = trim(sanitize_title($args['title']))) ? $st : md5(time()) );
237
+ $args['slug'] = $this->unique_slug($args['slug'], $args['parentid'], $args['forumid']);
238
 
239
  $args['description'] = wpforo_kses( stripslashes( wpfval($args, 'description') ) );
240
 
wpf-includes/class-members.php CHANGED
@@ -1325,21 +1325,21 @@ class wpForoMember{
1325
  }else{
1326
  if( in_array($f['type'], array('text','search','textarea'), true) ){
1327
  if( is_scalar($needle) ){
1328
- $needle = preg_quote(preg_quote($needle));
1329
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"[^\"]*". esc_sql($needle) ."[^\"]*\"'";
1330
  }elseif( is_array($needle) ){
1331
  foreach ($needle as $n){
1332
- $n = preg_quote(preg_quote($n));
1333
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"[^\"]*". esc_sql($n) ."[^\"]*\"'";
1334
  }
1335
  }
1336
  }else{
1337
  if( is_scalar($needle) ){
1338
- $needle = preg_quote(preg_quote($needle));
1339
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"". esc_sql($needle) ."\"'";
1340
  }elseif( is_array($needle) ){
1341
  foreach ($needle as $n){
1342
- $n = preg_quote(preg_quote($n));
1343
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"". esc_sql($n) ."\"'";
1344
  }
1345
  }
1325
  }else{
1326
  if( in_array($f['type'], array('text','search','textarea'), true) ){
1327
  if( is_scalar($needle) ){
1328
+ $needle = preg_quote(preg_quote( wpforo_encode($needle) ));
1329
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"[^\"]*". esc_sql($needle) ."[^\"]*\"'";
1330
  }elseif( is_array($needle) ){
1331
  foreach ($needle as $n){
1332
+ $n = preg_quote(preg_quote( wpforo_encode($n) ));
1333
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"[^\"]*". esc_sql($n) ."[^\"]*\"'";
1334
  }
1335
  }
1336
  }else{
1337
  if( is_scalar($needle) ){
1338
+ $needle = preg_quote(preg_quote( wpforo_encode($needle) ));
1339
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"". esc_sql($needle) ."\"'";
1340
  }elseif( is_array($needle) ){
1341
  foreach ($needle as $n){
1342
+ $n = preg_quote(preg_quote( wpforo_encode($n) ));
1343
  $wheres[] = "`fields` REGEXP '[{,]\"". $field ."\":(\\\[[^\\\[]*)?\"". esc_sql($n) ."\"'";
1344
  }
1345
  }
wpf-includes/functions-template.php CHANGED
@@ -1203,7 +1203,7 @@ function wpforo_member_nicename( $member = array(), $prefix = '', $bracket = tru
1203
  $nicename .= $prefix . urldecode($member['user_nicename']);
1204
  if( $bracket ) $nicename .= ')';
1205
  if( $wrap ){ $nicename .= '</div>';}
1206
- $nicename = apply_filters('wpforo_member_nicename', $nicename);
1207
  if( $echo ){ echo $nicename; } else{ return $nicename; }
1208
  }
1209
 
@@ -2739,7 +2739,7 @@ function wpforo_unread_button( $topicid = 0, $url = '', $echo = true, $postid =
2739
  function wpforo_forum_title($forum, $before = '', $after = '', $echo = true){
2740
  $title = is_array($forum) ? (string) wpfval($forum, 'title') : $forum;
2741
  $title = esc_html($title);
2742
- $title = apply_filters('wpforo_forum_title', $title);
2743
  if($title) $title = $before . $title . $after;
2744
  if($echo) echo $title;
2745
  return $title;
@@ -2755,7 +2755,7 @@ function wpforo_forum_title($forum, $before = '', $after = '', $echo = true){
2755
  */
2756
  function wpforo_forum_description($forum, $before = '', $after = '', $echo = true){
2757
  $description = is_array($forum) ? (string) wpfval($forum, 'description') : $forum;
2758
- $description = apply_filters('wpforo_forum_description', $description);
2759
  if($description) $description = $before . $description . $after;
2760
  if($echo) echo $description;
2761
  return $description;
1203
  $nicename .= $prefix . urldecode($member['user_nicename']);
1204
  if( $bracket ) $nicename .= ')';
1205
  if( $wrap ){ $nicename .= '</div>';}
1206
+ $nicename = apply_filters('wpforo_member_nicename', $nicename, $member);
1207
  if( $echo ){ echo $nicename; } else{ return $nicename; }
1208
  }
1209
 
2739
  function wpforo_forum_title($forum, $before = '', $after = '', $echo = true){
2740
  $title = is_array($forum) ? (string) wpfval($forum, 'title') : $forum;
2741
  $title = esc_html($title);
2742
+ $title = apply_filters('wpforo_forum_title', $title, $forum);
2743
  if($title) $title = $before . $title . $after;
2744
  if($echo) echo $title;
2745
  return $title;
2755
  */
2756
  function wpforo_forum_description($forum, $before = '', $after = '', $echo = true){
2757
  $description = is_array($forum) ? (string) wpfval($forum, 'description') : $forum;
2758
+ $description = apply_filters('wpforo_forum_description', $description, $forum);
2759
  if($description) $description = $before . $description . $after;
2760
  if($echo) echo $description;
2761
  return $description;
wpf-includes/functions.php CHANGED
@@ -1705,8 +1705,11 @@ function wpforo_find_image_urls( $content, $first = true, $type = 'general' ){
1705
  }
1706
 
1707
  function wpforo_is_json($string) {
1708
- json_decode($string);
1709
- return json_last_error() === JSON_ERROR_NONE;
 
 
 
1710
  }
1711
 
1712
  function wpforo_ajax_response( $message ) {
1705
  }
1706
 
1707
  function wpforo_is_json($string) {
1708
+ if( is_scalar($string) ){
1709
+ json_decode($string);
1710
+ return json_last_error() === JSON_ERROR_NONE;
1711
+ }
1712
+ return false;
1713
  }
1714
 
1715
  function wpforo_ajax_response( $message ) {
wpf-themes/classic/colors.css CHANGED
@@ -726,6 +726,14 @@ body.wpf-dark #wpf-msg-box a:hover, body.wpf-dark #wpf-msg-box a:active{color:#6
726
  #wpforo #wpforo-wrap.wpf-dark .wpf-acp-footer a.wpf-button-secondary {background: #777;color: #fff;}
727
  #wpforo #wpforo-wrap.wpf-dark .wpf-acp-footer a.wpf-button-secondary:last-child{color: #fff!important; background: #e22d00;}
728
 
 
 
 
 
 
 
 
 
729
  #wpforo #wpforo-wrap {
730
  font-size: 13px; width: 100%; padding:10px 0; margin:0px;
731
  }
726
  #wpforo #wpforo-wrap.wpf-dark .wpf-acp-footer a.wpf-button-secondary {background: #777;color: #fff;}
727
  #wpforo #wpforo-wrap.wpf-dark .wpf-acp-footer a.wpf-button-secondary:last-child{color: #fff!important; background: #e22d00;}
728
 
729
+
730
+ #wpforo #wpforo-wrap .wpf-topic-create .mce-top-part{position:absolute!important;bottom:-40px !important;z-index: 100; width: 100% !important;}
731
+ #wpforo #wpforo-wrap .wpf-topic-create .wp-editor-wrap {margin-bottom: 40px;}
732
+ #wpforo #wpforo-wrap .wpf-topic-create .mce-toolbar .mce-btn-group {padding-top: 8px;}
733
+
734
+ #wpforo #wpforo-wrap .wpf-post-create .mce-top-part{position:absolute!important;bottom:-40px !important;z-index: 100; width: 100% !important;}
735
+ #wpforo #wpforo-wrap .wpf-post-create .wp-editor-wrap {margin-bottom: 40px;}
736
+ #wpforo #wpforo-wrap .wpf-post-create .mce-toolbar .mce-btn-group {padding-top: 8px;}
737
  #wpforo #wpforo-wrap {
738
  font-size: 13px; width: 100%; padding:10px 0; margin:0px;
739
  }
wpforo.php CHANGED
@@ -5,14 +5,14 @@
5
  * Description: WordPress Forum plugin. wpForo is a full-fledged forum solution for your community. Comes with multiple modern forum layouts.
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
- * Version: 1.9.4
9
  * Text Domain: wpforo
10
  * Domain Path: /wpf-languages
11
  */
12
 
13
  //Exit if accessed directly
14
  if( !defined( 'ABSPATH' ) ) exit;
15
- if( !defined( 'WPFORO_VERSION' ) ) define('WPFORO_VERSION', '1.9.4');
16
 
17
  function wpforo_load_plugin_textdomain() { load_plugin_textdomain( 'wpforo', FALSE, basename( dirname( __FILE__ ) ) . '/wpf-languages/' ); }
18
  add_action( 'plugins_loaded', 'wpforo_load_plugin_textdomain' );
@@ -362,6 +362,7 @@ if( !class_exists( 'wpForo' ) ) {
362
  $url = preg_replace('#\#[^/?&]*$#isu', '', $url);
363
  parse_str( parse_url($url, PHP_URL_QUERY), $get );
364
  $get = array_merge( (array) $get, (array) $_GET );
 
365
 
366
  $this->current_url = apply_filters('wpforo_init_current_url', $url);
367
  $this->GET = apply_filters('wpforo_init_current_url_GET', $get);
5
  * Description: WordPress Forum plugin. wpForo is a full-fledged forum solution for your community. Comes with multiple modern forum layouts.
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
+ * Version: 1.9.5
9
  * Text Domain: wpforo
10
  * Domain Path: /wpf-languages
11
  */
12
 
13
  //Exit if accessed directly
14
  if( !defined( 'ABSPATH' ) ) exit;
15
+ if( !defined( 'WPFORO_VERSION' ) ) define('WPFORO_VERSION', '1.9.5');
16
 
17
  function wpforo_load_plugin_textdomain() { load_plugin_textdomain( 'wpforo', FALSE, basename( dirname( __FILE__ ) ) . '/wpf-languages/' ); }
18
  add_action( 'plugins_loaded', 'wpforo_load_plugin_textdomain' );
362
  $url = preg_replace('#\#[^/?&]*$#isu', '', $url);
363
  parse_str( parse_url($url, PHP_URL_QUERY), $get );
364
  $get = array_merge( (array) $get, (array) $_GET );
365
+ $get = wp_unslash($get);
366
 
367
  $this->current_url = apply_filters('wpforo_init_current_url', $url);
368
  $this->GET = apply_filters('wpforo_init_current_url_GET', $get);