refactor: upgrade to PHP 7.3
This commit is contained in:
parent
69d95206c0
commit
70c2954122
3 changed files with 8 additions and 16 deletions
|
@ -271,10 +271,7 @@ abstract class Engine {
|
|||
*/
|
||||
public function display_content(): void {
|
||||
$this->append_scripts();
|
||||
|
||||
// Get the current section.
|
||||
reset( $this->a_arr_sections );
|
||||
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
|
||||
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : array_key_first( $this->a_arr_sections );
|
||||
$l_arr_active_section = $this->a_arr_sections[ $l_str_active_section_id ];
|
||||
|
||||
// Store settings.
|
||||
|
@ -341,12 +338,7 @@ abstract class Engine {
|
|||
*/
|
||||
private function save_settings(): bool {
|
||||
$l_arr_new_settings = array();
|
||||
|
||||
// TODO: add nonce verification.
|
||||
|
||||
// Get current section.
|
||||
reset( $this->a_arr_sections );
|
||||
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
|
||||
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : array_key_first( $this->a_arr_sections );
|
||||
$l_arr_active_section = $this->a_arr_sections[ $l_str_active_section_id ];
|
||||
|
||||
foreach ( array_keys( Includes\Settings::instance()->get_defaults( $l_arr_active_section['container'] ) ) as $l_str_key ) {
|
||||
|
|
|
@ -192,7 +192,7 @@ class Init {
|
|||
// Get the body of the response.
|
||||
$l_str_response = $l_arr_response['body'];
|
||||
// Get plugin object.
|
||||
$l_arr_plugin = json_decode( $l_str_response, true );
|
||||
$l_arr_plugin = json_decode( $l_str_response, true, 512, JSON_THROW_ON_ERROR );
|
||||
if ( empty( $l_arr_plugin ) ) {
|
||||
echo wp_json_encode( array( 'error' => 'Error reading Plugin meta information.<br/>URL: ' . $l_str_url . '<br/>Response: ' . $l_str_response ) );
|
||||
exit;
|
||||
|
|
Reference in a new issue