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

Fix PHP deprecation errors #1988

Merged
merged 4 commits into from
Aug 9, 2023
Merged

Conversation

Utsav-Ladani
Copy link
Collaborator

@Utsav-Ladani Utsav-Ladani commented Aug 7, 2023

Fix PHP deprecated notices

These PHP deprecated notices are resolved

FILTER_SANITIZE_STRING filter deprecated

  • FILTER_SANITIZE_STRING is deprecated in the latest PHP versions.
  • According to PHP docs, It is solved by replacing FILTER_SANITIZE_STRING to FILTER_SANITIZE_FULL_SPECIAL_CHARS.

Dynamic property creation is not allowed

  • This error occurs if we use a class data member without declaring it in class.
     class Some_Class {
     	public function __constructure () {
     		// In the below line, we get an error in the latest version of PHP because we didn't declare the data member `$some_var` in class.
     	$this->some_var = 123;
     	}
    
     /**
      * It can be fixed by declaring data members in the class.
      */
     class Some_Class {
     	public $some_var;
    
     	public function __constructure ()
     		$this->some_var = 123;
     	}
     }
  • It is produced by the RTMediaUserInteraction class, where strings are passed as args and are used to create class properties dynamically.
  • It is solved by adding those properties to the RTMediaUserInteraction class.

Note

  • These changes are support for 7.0 and later versions of PHP.

Related Issue

@pavanpatil1 pavanpatil1 merged commit 4e6fbd3 into pre-release Aug 9, 2023
1 check 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.

3 participants