Skip to content

Commit 5269a45

Browse files
authored
Merge pull request #1630 from rtMediaWP/develop
Version update v4.6.2
2 parents d5f8667 + bca1c20 commit 5269a45

File tree

12 files changed

+222
-137
lines changed

12 files changed

+222
-137
lines changed

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Add albums, photo, audio/video upload, privacy, sharing, front-end uploads & mor
1111
![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=MU1JamdmRnppK0hhQy9QMU8wdDJ2MUEyb1ZuS0ljVFQvSHZ6anFvNzUxTT0tLXhUNnliTnZGcE5CcW93N0I1eXdnM3c9PQ==--8c124e667dd0c317618efde1bed2b260000916b6)
1212

1313

14-
* **Contributors:** [rtcamp](http://profiles.wordpress.org/rtcamp), [mangeshp](http://profiles.wordpress.org/mangeshp), [sanket.parmar](http://profiles.wordpress.org/sanket.parmar), [pranalipatel](http://profiles.wordpress.org/pranalipatel), [jignesh.nakrani](http://profiles.wordpress.org/jignesh.nakrani), [manishsongirkar36](http://profiles.wordpress.org/manishsongirkar36), [kiranpotphode](http://profiles.wordpress.org/kiranpotphode), [yahil](http://profiles.wordpress.org/yahil), [1naveengiri](http://profiles.wordpress.org/1naveengiri), [bhargavbhandari90](http://profiles.wordpress.org/bhargavbhandari90), [deepak1191](http://profiles.wordpress.org/deepak1191), [rittesh.patel](http://profiles.wordpress.org/rittesh.patel), [sagarjadhav](http://profiles.wordpress.org/sagarjadhav), [pushpak.pop](http://profiles.wordpress.org/pushpak.pop), [faishal](http://profiles.wordpress.org/faishal), [desaiuditd](http://profiles.wordpress.org/desaiuditd), [rahul286](http://profiles.wordpress.org/rahul286), [JoshuaAbenazer](http://profiles.wordpress.org/JoshuaAbenazer), [gagan0123](http://profiles.wordpress.org/gagan0123), [saurabhshukla](http://profiles.wordpress.org/saurabhshukla), [nitun.lanjewar](http://profiles.wordpress.org/nitun.lanjewar), [umesh.nevase](http://profiles.wordpress.org/umesh.nevase), [suhasgirgaonkar](http://profiles.wordpress.org/suhasgirgaonkar), [neerukoul](http://profiles.wordpress.org/neerukoul), [hrishiv90](http://profiles.wordpress.org/hrishiv90), [kanakiyajay](http://profiles.wordpress.org/kanakiyajay), [jarretc](http://profiles.wordpress.org/jarretc), [tobiaskluge](http://profiles.wordpress.org/tobiaskluge), [rafaelfunchal](http://profiles.wordpress.org/rafaelfunchal), [UmeshSingla](http://profiles.wordpress.org/UmeshSingla), [mehulkaklotar](http://profiles.wordpress.org/mehulkaklotar), [tannermirabel](http://profiles.wordpress.org/tannermirabel), [kishores](http://profiles.wordpress.org/kishores), [chandrapatel](http://profiles.wordpress.org/chandrapatel), [rahul3883](http://profiles.wordpress.org/rahul3883/), [nomnom99](http://profiles.wordpress.org/nomnom99), [sayanchakraborty](https://profiles.wordpress.org/sayanchakraborty), [milindmore22](https://profiles.wordpress.org/milindmore22), [thrijith](https://profiles.wordpress.org/thrijith), [abhijitrakas](https://profiles.wordpress.org/abhijitrakas), [sid177](https://profiles.wordpress.org/sid177), [montu3366](https://profiles.wordpress.org/montu3366), [jashwini](https://profiles.wordpress.org/jashwini), [juhise](https://profiles.wordpress.org/juhise), [ravatparmar](https://profiles.wordpress.org/ravatparmar), [dharmin16](https://profiles.wordpress.org/dharmin16), [malavvasita](https://profiles.wordpress.org/malavvasita), [pooja1210](https://profiles.wordpress.org/pooja1210), [krupajnanda](https://profiles.wordpress.org/krupajnanda), [kanumalivad](https://profiles.wordpress.org/kanumalivad), [surajkumarsingh](https://profiles.wordpress.org/surajkumarsingh), [dishitpala](https://profiles.wordpress.org/dishitpala)
14+
* **Contributors:** [rtcamp](http://profiles.wordpress.org/rtcamp), [mangeshp](http://profiles.wordpress.org/mangeshp), [sanket.parmar](http://profiles.wordpress.org/sanket.parmar), [pranalipatel](http://profiles.wordpress.org/pranalipatel), [jignesh.nakrani](http://profiles.wordpress.org/jignesh.nakrani), [manishsongirkar36](http://profiles.wordpress.org/manishsongirkar36), [kiranpotphode](http://profiles.wordpress.org/kiranpotphode), [yahil](http://profiles.wordpress.org/yahil), [1naveengiri](http://profiles.wordpress.org/1naveengiri), [bhargavbhandari90](http://profiles.wordpress.org/bhargavbhandari90), [deepak1191](http://profiles.wordpress.org/deepak1191), [rittesh.patel](http://profiles.wordpress.org/rittesh.patel), [sagarjadhav](http://profiles.wordpress.org/sagarjadhav), [pushpak.pop](http://profiles.wordpress.org/pushpak.pop), [faishal](http://profiles.wordpress.org/faishal), [desaiuditd](http://profiles.wordpress.org/desaiuditd), [rahul286](http://profiles.wordpress.org/rahul286), [JoshuaAbenazer](http://profiles.wordpress.org/JoshuaAbenazer), [gagan0123](http://profiles.wordpress.org/gagan0123), [saurabhshukla](http://profiles.wordpress.org/saurabhshukla), [nitun.lanjewar](http://profiles.wordpress.org/nitun.lanjewar), [umesh.nevase](http://profiles.wordpress.org/umesh.nevase), [suhasgirgaonkar](http://profiles.wordpress.org/suhasgirgaonkar), [neerukoul](http://profiles.wordpress.org/neerukoul), [hrishiv90](http://profiles.wordpress.org/hrishiv90), [kanakiyajay](http://profiles.wordpress.org/kanakiyajay), [jarretc](http://profiles.wordpress.org/jarretc), [tobiaskluge](http://profiles.wordpress.org/tobiaskluge), [rafaelfunchal](http://profiles.wordpress.org/rafaelfunchal), [UmeshSingla](http://profiles.wordpress.org/UmeshSingla), [mehulkaklotar](http://profiles.wordpress.org/mehulkaklotar), [tannermirabel](http://profiles.wordpress.org/tannermirabel), [kishores](http://profiles.wordpress.org/kishores), [chandrapatel](http://profiles.wordpress.org/chandrapatel), [rahul3883](http://profiles.wordpress.org/rahul3883/), [nomnom99](http://profiles.wordpress.org/nomnom99), [sayanchakraborty](https://profiles.wordpress.org/sayanchakraborty), [milindmore22](https://profiles.wordpress.org/milindmore22), [thrijith](https://profiles.wordpress.org/thrijith), [abhijitrakas](https://profiles.wordpress.org/abhijitrakas), [sid177](https://profiles.wordpress.org/sid177), [montu3366](https://profiles.wordpress.org/montu3366), [jashwini](https://profiles.wordpress.org/jashwini), [juhise](https://profiles.wordpress.org/juhise), [ravatparmar](https://profiles.wordpress.org/ravatparmar), [dharmin16](https://profiles.wordpress.org/dharmin16), [malavvasita](https://profiles.wordpress.org/malavvasita), [pooja1210](https://profiles.wordpress.org/pooja1210), [krupajnanda](https://profiles.wordpress.org/krupajnanda), [kanumalivad](https://profiles.wordpress.org/kanumalivad), [surajkumarsingh](https://profiles.wordpress.org/surajkumarsingh), [dishitpala](https://profiles.wordpress.org/dishitpala), [shobhit2412](https://profiles.wordpress.org/shobhit2412/)
1515

1616

1717
* **License:** [GPL v2 or later]( http://www.gnu.org/licenses/gpl-2.0.html)
@@ -147,6 +147,16 @@ https://www.youtube.com/watch?v=dJrykKQGDcs
147147

148148
## Changelog ##
149149

150+
### 4.6.2 [April 22, 2020] ###
151+
152+
* FIXED
153+
* Redirection to WallPost album for user with subscriber role
154+
* Preview not loading for Docs and Other files in lightbox
155+
* Custom css not applying when added from rtMedia settings’ custom css tab
156+
* Too many redirections on BuddyPress’ privacy page.
157+
* Unable to delete media from lightbox and single media page.
158+
* PHP errors and warning
159+
150160
### 4.6.1 [April 9, 2020] ###
151161

152162
* Enhancement
@@ -1675,8 +1685,8 @@ https://www.youtube.com/watch?v=dJrykKQGDcs
16751685
* HTML5 Audio Tag Support (with fallback)
16761686
* HTML5 Video Tag Support (with fallback)
16771687

1678-
#### 4.6.1 ####
1679-
rtMedia 4.6.1 with added server side validation for terms of services checkbox, minor bug fixes along with warnings and PHPCS fixes
1688+
#### 4.6.2 ####
1689+
rtMedia 4.6.2 with added fixes for preview not loading of docs and files in lightbox, privacy page redirection on user's profile along with warnings and PHP errors
16801690

16811691
## Sponsors ##
16821692

app/main/RTMedia.php

+18-1
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@ public function enqueue_scripts_styles() {
13221322
wp_localize_script( 'rtmedia-magnific', 'rtmedia_load_more', __( 'Loading media', 'buddypress-media' ) );
13231323
wp_localize_script( 'rtmedia-main', 'rtmedia_empty_activity_msg', __( 'Please enter some content to post.', 'buddypress-media' ) );
13241324
wp_localize_script( 'rtmedia-main', 'rtmedia_empty_comment_msg', __( 'Empty comment is not allowed.', 'buddypress-media' ) );
1325+
wp_localize_script( 'rtmedia-main', 'rtmedia_media_delete_confirmation', __( 'Are you sure you want to delete this media?', 'buddypress-media' ) );
13251326
wp_localize_script( 'rtmedia-main', 'rtmedia_media_comment_delete_confirmation', __( 'Are you sure you want to delete this comment?', 'buddypress-media' ) );
13261327
wp_localize_script( 'rtmedia-main', 'rtmedia_album_delete_confirmation', __( 'Are you sure you want to delete this Album?', 'buddypress-media' ) );
13271328
wp_localize_script( 'rtmedia-main', 'rtmedia_drop_media_msg', __( 'Drop files here', 'buddypress-media' ) );
@@ -1554,6 +1555,15 @@ public function enqueue_scripts_styles() {
15541555
if ( empty( $is_buddypress_activate ) ) {
15551556
wp_localize_script( 'rtmedia-main', 'ajaxurl', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );
15561557
}
1558+
1559+
$options = $rtmedia->options;
1560+
// Previously done with rtmedia_custom_css() method on wp_head hook.
1561+
if ( ! empty( $options['styles_custom'] ) ) {
1562+
wp_register_style( 'rtmedia-custom-css', false );
1563+
wp_enqueue_style( 'rtmedia-custom-css' );
1564+
$css = stripslashes( wp_filter_nohtml_kses( $options['styles_custom'] ) );
1565+
wp_add_inline_style( 'rtmedia-custom-css', $css );
1566+
}
15571567
}
15581568

15591569
/**
@@ -1729,6 +1739,13 @@ public function unset_bp_media_image_sizes( $sizes ) {
17291739
public static function expanded_allowed_tags() {
17301740
$new_allowed = wp_kses_allowed_html( 'post' );
17311741

1742+
// Iframe.
1743+
$new_allowed['iframe'] = array(
1744+
'src' => array(),
1745+
'class' => array(),
1746+
'id' => array(),
1747+
);
1748+
17321749
// form input.
17331750
$new_allowed['form'] = array(
17341751
'action' => array(),
@@ -1842,7 +1859,7 @@ function parentlink_global_album( $id ) {
18421859
$parent_link = '';
18431860

18441861
if ( is_array( $global_albums ) && '' !== $global_albums ) {
1845-
if ( in_array( $id, $global_albums, true ) && function_exists( 'bp_displayed_user_id' ) ) {
1862+
if ( in_array( $id, $global_albums, false ) && function_exists( 'bp_displayed_user_id' ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.FoundNonStrictFalse -- This option sometimes comes from buddypress or normal options, so can't be sure.
18461863
$disp_user = bp_displayed_user_id();
18471864
$curr_user = get_current_user_id();
18481865
if ( $disp_user === $curr_user ) {

app/main/controllers/privacy/RTMediaPrivacy.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,10 @@ public function rt_privacy_settings_action() {
466466
$default_privacy = sanitize_text_field( filter_input( INPUT_POST, 'rtmedia-default-privacy', FILTER_SANITIZE_STRING ) );
467467
$nonce = sanitize_text_field( filter_input( INPUT_POST, 'rtmedia_member_settings_privacy', FILTER_SANITIZE_STRING ) );
468468

469-
if ( ! empty( $default_privacy ) || 0 === intval( $default_privacy ) ) {
470-
469+
// Old condition won't work as we've added sanitize_text_field for $default_privacy.
470+
// We can't perform empty as 0 could be the possible value, so we check for empty string instead.
471+
// Condition intval( $default_privacy ) will always 0 which shouldn't happen.
472+
if ( 0 !== strlen( strval( $default_privacy ) ) ) {
471473
$status = false;
472474
if ( wp_verify_nonce( $nonce, 'rtmedia_member_settings_privacy' ) ) {
473475
// todo user attribute.

app/main/controllers/template/RTMediaTemplate.php

+26-4
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,33 @@ public function media_update_success_messege() {
459459

460460
/**
461461
* Show error message for media update error.
462+
*
463+
* @return void
462464
*/
463465
public function media_update_success_error() {
464-
$message = apply_filters( 'rtmedia_update_media_message', esc_html__( 'Error in updating Media', 'buddypress-media' ), true );
465-
$html = "<div class='rtmedia-error media-edit-messge'>" . esc_html( $message ) . '</div>';
466+
/**
467+
* To filter error message on media update.
468+
*
469+
* @param string $message Raw error message.
470+
* @param bool $bool
471+
*
472+
* @return string Raw error message.
473+
*/
474+
$message = apply_filters( 'rtmedia_update_media_message', __( 'Error in updating Media', 'buddypress-media' ), true );
475+
$html = sprintf( '<div class="rtmedia-warning media-edit-messge">%s</div>', esc_html( $message ) );
476+
477+
/**
478+
* To filter error message HTML on media update.
479+
*
480+
* @param string $html HTML of error message.
481+
* @param string $message Raw error message.
482+
* @param bool $bool
483+
*
484+
* @return string HTML of error message.
485+
*/
486+
$html = apply_filters( 'rtmedia_update_media_message_html', $html, $message, true );
466487

467-
echo wp_kses( apply_filters( 'rtmedia_update_media_message_html', $html, $message, true ), RTMedia::expanded_allowed_tags() );
488+
echo wp_kses( $html, RTMedia::expanded_allowed_tags() );
468489
}
469490

470491
/**
@@ -871,7 +892,8 @@ public function check_return_comments() {
871892
global $wpdb;
872893

873894
$comments = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_ID = %d limit 100", $id ), ARRAY_A );
874-
echo wp_kses( rmedia_single_comment( $comments ), RTMedia::expanded_allowed_tags() );
895+
// @todo: Change a.rtmedia-comment-like-click attribute to data-comment-id from data-comment_id in rtmedia-likes (https://github.com/rtCamp/rtmedia-likes) addon.
896+
echo rmedia_single_comment( $comments ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Contains data-* attributes.
875897
exit;
876898
}
877899
} else {

app/main/controllers/template/rtmedia-functions.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,8 @@ function rtmedia_comments( $echo = true ) {
13501350
}
13511351

13521352
if ( $html ) {
1353-
echo wp_kses( $html, RTMedia::expanded_allowed_tags() );
1353+
// @todo: Change a.rtmedia-comment-like-click attribute to data-comment-id from data-comment_id in rtmedia-likes (https://github.com/rtCamp/rtmedia-likes) addon.
1354+
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Contains data-* attributes.
13541355
} else {
13551356
return $html;
13561357
}

app/main/routers/RTMediaRouter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function rt_theme_compat_reset_post( $args = array() ) {
242242
break;
243243
}
244244
}
245-
} elseif ( isset( $rtmedia_query->media ) && 1 === count( $rtmedia_query->media ) && $rtmedia_query->media ) {
245+
} elseif ( ! empty( $rtmedia_query->media[0] ) && isset( $rtmedia_query->media[0]->media_id ) ) {
246246
$wp_query->post = get_post( $rtmedia_query->media[0]->media_id );
247247
}
248248

bin/.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ before_script:
5454
- unzip BrowserStackLocal-linux-x64.zip
5555
- nohup ./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY &
5656
- cd $PLUGIN_DIR/tests/codeception/
57-
- composer update
58-
# - composer install
57+
# - composer update
58+
- composer install
5959
- export PATH="$PATH:/home/travis/build/rtMediaWP/rtMedia/tests/codeception/vendor/bin"
6060
## PHP_CodeSniffer
6161
- git clone https://github.com/squizlabs/PHP_CodeSniffer.git

index.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
44
Plugin URI: https://rtmedia.io/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
55
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6-
Version: 4.6.1
6+
Version: 4.6.2
77
Author: rtCamp
88
Text Domain: buddypress-media
99
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
@@ -21,7 +21,7 @@
2121
/**
2222
* The version of the plugin
2323
*/
24-
define( 'RTMEDIA_VERSION', '4.6.1' );
24+
define( 'RTMEDIA_VERSION', '4.6.2' );
2525
}
2626

2727
if ( ! defined( 'RTMEDIA_PATH' ) ) {

0 commit comments

Comments
 (0)