Skip to content

Conversation

@KMchaudhary
Copy link
Contributor

@KMchaudhary KMchaudhary commented Oct 23, 2025

  • FIXED
    • Apply security recommendations and fixes.
    • Restrict the media upload by its types based on selected tab in rtMedia gallery.
  • ENHANCEMENT
    • Enhances media upload support by adding a broader set of commonly used video and audio formats.
    • Replace PHP file system functions with WordPress alternative filesystem function to enhance security.

KMchaudhary and others added 13 commits October 3, 2025 12:47
Fix: Missing Authorization to Unauthenticated Information Disclosure via handle_rest_pre_dispatch Function
rtMedia Gallery Allowed Media Upload of all types for different Media types
…evelop

Add new formats for audio and video.
* Address the Direct database call queries, and no-caching security issues

app/importers/* ignore the phpcs errors, as app/importers directory contains data migration and import utilities which require direct DB calls and caching of queries should not be there for such operations

* Fix phpcs indentation fixes

* Fix the WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared PHPCS erros

* Fix the WordPress.Security.ValidatedSanitizedInput.InputNotValidated issue on RTMediaMigration.php file

* Fix mission validation, sanitization issues, and few nonce verification issues

* fix: add proper ignore comments for nonce verification

* Fixed Filesystem errors in rtUploadAttachment

* Fixed filesystem errors in RTMediaSupport

* Fixed filesystem errors in BPMediaImporter

* fix: missing nonce handle

* fix: update the nonce comment to explain more elaborately

* feat: add nonce for todos

* fix: repeated phpcs:ignore

* Resolve the all posible inline script related issues

* Add missing changes for godam notice dismisal

* Replace inline script form upload-file-types notices template

* Made filechanges fixes for RTMediaAdmin.php

* Made filechanges fixes for RTMediaSupport.php

* Made filechanges fixes for RTDBUpdate.php

* Made filechanges fixes for BPMediaImporter.php

* Made filechanges fixes for RTMediaMigration.php

* Made filechanges fixes for RTMediaMedia.php

* Made filechanges fixes for RTMediaUploadFile.php

* Move rtmedia-migration page inline script into migration.js

* Add localize variables with rtmedia-main.js for rtmedia-actions.php file

* Remove console logs

* fix: nonce action for convert_videos_mailchimp_send ajax call

* feat: hide global album function nonce error

* Code refactoring and add fix nonce input element selector

* Remove begug comments

* feat: update nonce comment for global album

* Revert "Fix Nonce Verification flags in the Codebase"

* Revert "Revert "Fix Nonce Verification flags in the Codebase""

* Add comments for unchanged <script> and <style> tags

* feat: add nonce for file upload

* Sanitization and Nonce changes

* Undo redundant nonce verification

* Fixed PHPCS Issues

* Add missing sanitization, and input validation functions

* Add phpcs:ignore comment for missing nonce verification

* Refactored the changes to sanitize individually

* Implemented PR feedback

* Implemented Feedback changes

* Add documentation related changes

* Implemented Copilot changes

* Remove unused variable

* Revert "Fix Sanitization issues " (#2199)

* Made bug fixes for nonce verification

* Removed nonce verification from places not required.

* Updated todo comment

* fix: remove nonce from mailchimp verification

* Re-added the sanitization changes

* Added documentation

* Bug fix for media not loading

* Bug Fix for filter

* Made bug fixes for group featureed media

---------

Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
Co-authored-by: Vedant Gandhi <vedantgandhipersonal@gmail.com>
Co-authored-by: Chirag Mathur <mchirag2002@gmail.com>
Co-authored-by: Chirag Mathur <71757438+mchirag2002@users.noreply.github.com>
* Version update v4.7.4

* Add vedantgandhi28 wordpress profile in contributor list

---------

Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
Comment on lines +5 to +18
name: Run PHPCS inspection
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run PHPCS inspection
uses: rtCamp/action-phpcs-code-review@master
env:
SKIP_FOLDERS: "tests,.github,lib,node_modules,vendor"
GH_BOT_TOKEN: ${{ secrets.RTBOT_TOKEN }}
PHPCS_SNIFFS_EXCLUDE: "WordPress.Files.FileName"
with:
args: WordPress,WordPress-Core,WordPress-Docs No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 2 months ago

To fix the issue, the workflow file (.github/workflows/phpcs_on_pull_request.yml) should be edited to include a permissions: block. According to recommended practice, this block can be set at the workflow root (applies to all jobs by default, unless jobs override it), or at the individual job level. Since the job appears to only need to read repository contents (for code checkout and inspection), setting contents: read may be sufficient. If the inspection action posts comments or reviews to pull requests, then pull-requests: write should also be added. The best method is to add the permissions: block directly beneath name: at the root of the YAML file, above the jobs: block.

No additional methods, libraries, or dependencies are needed; only the YAML key should be added.

Suggested changeset 1
.github/workflows/phpcs_on_pull_request.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/phpcs_on_pull_request.yml b/.github/workflows/phpcs_on_pull_request.yml
--- a/.github/workflows/phpcs_on_pull_request.yml
+++ b/.github/workflows/phpcs_on_pull_request.yml
@@ -1,5 +1,7 @@
 on: pull_request
 name: Inspections
+permissions:
+  contents: read
 jobs:
   runPHPCSInspection:
     name: Run PHPCS inspection
EOF
@@ -1,5 +1,7 @@
on: pull_request
name: Inspections
permissions:
contents: read
jobs:
runPHPCSInspection:
name: Run PHPCS inspection
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
gagan0123 and others added 3 commits October 27, 2025 16:04
… support (#2204)

* Remove mxf, vob, and mts file format support, and add m4v file format support

* Fix media_type attribute issue on rtmedia/uploader block and rtmedia_uploader shortcode

---------

Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
@rtBot
Copy link
Contributor

rtBot commented Oct 30, 2025

Unable to PHPCS or SVG scan one or more files due to error running PHPCS/SVG scanner:

  • Gruntfile.js
  • app/admin/RTMediaAdmin.php
  • app/admin/RTMediaFormHandler.php
  • app/admin/RTMediaUploadTermsAdmin.php
  • app/admin/templates/dashboard-widgets/right-now.php
  • app/admin/templates/notices/addon-update.php
  • app/admin/templates/notices/inspirebook-release.php
  • app/admin/templates/notices/premium-addon.php
  • app/admin/templates/notices/transcoder.php
  • app/admin/templates/notices/update-template.php
  • app/admin/templates/notices/upload-file-types.php
  • app/admin/templates/settings/main.php
  • app/admin/templates/settings/media-sizes.php
  • app/assets/admin/js/importer.js
  • app/assets/admin/js/importer.min.js
  • app/assets/admin/js/migration.js
  • app/assets/admin/js/migration.min.js
  • app/assets/admin/js/rtmedia-admin.js
  • app/assets/admin/js/rtmedia-admin.min.js
  • app/assets/admin/js/settings.js
  • app/assets/js/rtMedia.backbone.js
  • app/assets/js/wp67-mediaelement-init.js
  • app/assets/js/wp67-mediaelement-init.min.js
  • app/helper/RTMediaCommentNotification.php
  • app/helper/RTMediaLikeNotification.php
  • app/helper/RTMediaModel.php
  • app/helper/RTMediaSettings.php
  • app/helper/RTMediaSupport.php
  • app/helper/db/RTDBUpdate.php
  • app/helper/rtDimensions.php
  • app/helper/rtForm.php
  • app/helper/rtProgress.php
  • app/helper/rtUploadAttachment.php
  • app/importers/BPMediaAlbumimporter.php
  • app/importers/BPMediaImporter.php
  • app/importers/RTMediaActivityUpgrade.php
  • app/importers/RTMediaMediaSizeImporter.php
  • app/importers/RTMediaMigration.php
  • app/importers/templates/activity-upgrade.php
  • app/importers/templates/media-size-importer.php
  • app/main/RTMedia.php
  • app/main/contexts/RTMediaContext.php
  • app/main/controllers/activity/RTMediaActivity.php
  • app/main/controllers/activity/RTMediaBuddyPressActivity.php
  • app/main/controllers/api/RTMediaJsonApi.php
  • app/main/controllers/api/RTMediaJsonApiFunctions.php
  • app/main/controllers/group/RTMediaBuddyPressGroupActivity.php
  • app/main/controllers/group/RTMediaGroup.php
  • app/main/controllers/group/RTMediaGroupExtension.php
  • app/main/controllers/media/RTMediaAlbum.php
  • app/main/controllers/media/RTMediaComment.php
  • app/main/controllers/media/RTMediaFeatured.php
  • app/main/controllers/media/RTMediaGalleryItemAction.php
  • app/main/controllers/media/RTMediaGroupFeatured.php
  • app/main/controllers/media/RTMediaLike.php
  • app/main/controllers/media/RTMediaMedia.php
  • app/main/controllers/media/RTMediaMeta.php
  • app/main/controllers/media/RTMediaUserInteraction.php
  • app/main/controllers/media/RTMediaViewCount.php
  • app/main/controllers/shortcodes/RTMediaGalleryShortcode.php
  • app/main/controllers/shortcodes/RTMediaUploadShortcode.php
  • app/main/controllers/template/RTMediaTemplate.php
  • app/main/controllers/template/RTMediaUploadTemplate.php
  • app/main/controllers/template/rtmedia-actions.php
  • app/main/controllers/template/rtmedia-ajax-actions.php
  • app/main/controllers/template/rtmedia-filters.php
  • app/main/controllers/template/rtmedia-functions.php
  • app/main/controllers/upload/RTMediaUploadEndpoint.php
  • app/main/controllers/upload/RTMediaUploadView.php
  • app/main/controllers/upload/processors/RTMediaUploadFile.php
  • app/main/interactions/RTMediaInteraction.php
  • app/main/routers/query/RTMediaQuery.php
  • app/main/templates/media-pagination.php
  • bin/class-wordpress-readme-parser.php
  • index.php
  • templates/media/album-gallery-item.php
  • templates/media/media-gallery-item.php
  • templates/upload/comment-media.php
  • templates/upload/uploader.php

The error may be temporary. If the error persists, please contact a human (commit-ID: ddbe344).

Copy link

@kishan-gondaliya-7270 kishan-gondaliya-7270 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock merge as it is already reviewed by @gagan0123

@nitun nitun merged commit a49d573 into master Oct 30, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants