Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Error Can't use function return value in write while activating Redux #200

@mohammedeisa

Description

@mohammedeisa

Issue description:

A client complained that he got the following error while activating Redux:

Fatal error: Can't use function return value in write context in /home1/landmark/public_html/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-functions-ex.php on line 196

Steps to reproduce"

I'm not able to reproduce the issue but the code shows that there is an issue that can be fixed even without the need to replicate the issue.

The current code:

Here is the function:
public static function s() { if ( ! empty( get_option( 'redux_p' . 'ro_lic' . 'ense_key', false ) ) ) { // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found $s = get_option( 'redux_p' . 'ro_l' . 'icense_status', false ); // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found if ( ! empty( $s ) && in_array( $s, array( 'valid', 'site_inactive' ), true ) ) { return true; } } return false; }

Proposed solution:

Split line 196 into two lines to be like the following:

public static function s() { $redux_pro_license_key= get_option( 'redux_p' . 'ro_lic' . 'ense_key', false ) ; if ( ! empty($redux_pro_license_key) ) { // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found $s = get_option( 'redux_p' . 'ro_l' . 'icense_status', false ); // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found if ( ! empty( $s ) && in_array( $s, array( 'valid', 'site_inactive' ), true ) ) { return true; } } return false; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions