Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPS-1063: UAE Lite remove the instace of //phpcs:ignore WordPress.Security in the repo #1064

Closed
wants to merge 8 commits into from

Conversation

akshayurankar48
Copy link
Contributor

@akshayurankar48 akshayurankar48 commented Jan 30, 2025

Description

Improvement: Enhanced the codebase to strengthen security measures.

Screenshots

Types of changes

How has this been tested?

Checklist:

  • My code is tested
  • My code passes the PHPCS tests
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@akshayurankar48 akshayurankar48 changed the title sanitized fields EPS-1063: UAE Lite remove the instace of //phpcs:ignore WordPress.Security in the repo Jan 30, 2025

// If action coming from general settings page.
if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
* Save analytics option to network.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why code indentaions is always messed up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted this changes as it's from the analytics folder @sushmak02

echo $header_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

if ( ! empty( $header_content ) ) {
echo wp_kses_post( $header_content ); // Properly escaped output
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to confirm if the content is displaying correctly, prepare detailed testcases for this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 We can't escape this as it is breaking the search bar. The input field is not displaying on the front end.


if ( ! empty( $footer_content ) ) {
echo "<div class='footer-width-fixer'>";
echo wp_kses_post( $footer_content ); // Properly escaped output
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here too

Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 here as well We can't escape this as it is breaking the search bar. The input field is not displaying on the front end.

Copy link
Collaborator

@sushmak02 sushmak02 left a comment

Choose a reason for hiding this comment

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

Added comments in the PR

@ShubhamGupta05 ShubhamGupta05 self-requested a review February 25, 2025 09:11
Copy link
Contributor

@ShubhamGupta05 ShubhamGupta05 left a comment

Choose a reason for hiding this comment

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

Most of the scenarios are failing when adding search widget or icon related setting. Test the scenarios once at your end.

echo $header_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

if ( ! empty( $header_content ) ) {
echo wp_kses_post( $header_content ); // Properly escaped output
Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 We can't escape this as it is breaking the search bar. The input field is not displaying on the front end.


if ( ! empty( $footer_content ) ) {
echo "<div class='footer-width-fixer'>";
echo wp_kses_post( $footer_content ); // Properly escaped output
Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 here as well We can't escape this as it is breaking the search bar. The input field is not displaying on the front end.

*
* @since 1.6.0
* @return void
*/
public function hfe_settings_page() {
echo '<h1 class="hfe-heading-inline">';
esc_attr_e( 'Elementor Header & Footer Builder ', 'header-footer-elementor' );
esc_html_e( 'Elementor Header & Footer Builder', 'header-footer-elementor' );
Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 Have you tested this at your end? I tried finding this, but I checked that this code is for an old version setting page that is not used now. So how can we check this?

@@ -812,7 +812,7 @@ protected function render():void {
}
$output .= '</ul>';

echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo wp_kses_post( $output );
Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 we can't even escape that as it is breaking the icon for the widget. For example, Add a home icon or change the separator from text to icon and add separator icon with this fix it will not show.


if ( ! empty( $before_footer_content ) ) {
echo "<div class='footer-width-fixer'>";
echo wp_kses_post( $before_footer_content ); // Properly escaped output
Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayurankar48 escaping this will also break icons in elementor. If I use search bar or elementor widget icon box to show before footer. It will not render there icons.

As discussed with team the icons are not even escaped at elementor end and if we use different function it break at one or another instance of testing
@ShubhamGupta05
Copy link
Contributor

Closing this PR as raised the new one to just add comment for instances - #1154

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.

3 participants