• Hi,

    I need assistance with a PHP error. The log says:

    
    [23-Jun-2019 09:46:30 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/fbm22apr/public_html/wp-content/plugins/content-control/classes/Shortcodes.php on line 69
    

    Here is the code written inside.

    
    61	/**
    62	 * Takes empty attributes and sets them to true.
    63	 *
    64	 * @param $atts
    65	 *
    66	 * @return mixed
    67	 */
    68	public static function normalize_empty_atts( $atts ) {
    68		foreach ( $atts as $attribute => $value ) {
    69			if ( is_int( $attribute ) ) {
    70				$atts[ strtolower( $value ) ] = true;
    71				unset( $atts[ $attribute ] );
    72			}
    73		}
    74
    75		return $atts;
    76	}
    
    • This topic was modified 5 years, 5 months ago by Jan Dembowski. Reason: Formatting

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @apartmentsforrentx – The error is coming from line 68 even though it says 69. I’m not sure why it would generate an error there as $atts should always be an array, but you can try this:

    Change

    foreach ( $atts as $attribute => $value ) {

    To

    foreach ( (array) $atts as $attribute => $value ) {

    Let me know.

    Thread Starter apartmentsforrentx

    (@apartmentsforrentx)

    Hi,

    This is a bit alarming. The error got worse

    [26-Jun-2019 10:15:41 UTC] PHP Fatal error: Uncaught Error: Cannot unset string offsets in plugins/content-control/classes/Shortcodes.php:71

    71 unset( $atts[ $attribute ] );

    Thread Starter apartmentsforrentx

    (@apartmentsforrentx)

    Hello moderators, please delete this topic for security reasons from public view.

    Plugin Author Daniel Iser

    (@danieliser)

    @apartmentsforrentx – what security reason could you have except that you put a link to your site on the first ticket. Otherwise I can’t see an actually security issue here.

    Am I missing something?

    Also crappy temporary hack but since we have seen this error a few times with no real reason why it should occur would it be possible for you to paste the shortcodes used on your site from our plugin.

    And if possible add in a var_dump($atts) exit; then load the page where it should be rendered. Instead it will simply output the variable $atts and end. Copy that here and delete the var_dump and exit lines.

    Let me know. Would love to solve this one once and for all.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Topics are only edited in extreme cases and search engine hits are never considered extreme.

    https://www.ads-software.com/support/forum-user-guide/faq/#my-post-shows-up-on-a-search-for-my-domain-will-you-delete-my-post-or-my-link

    Hello moderators, please delete this topic for security reasons from public view.

    There is nothing in this topic that is even remotely a security concern. Your topic will not be deleted.

    Thread Starter apartmentsforrentx

    (@apartmentsforrentx)

    Hello again Sir Jan Dembowski,

    I understand the policy for deleting topics. But, my website’s security is at stake, since 2 days ago, 20 daily hack attempts are reported by my security plugin. Which is very unusual and alarming. We know that different hack methods are on the web, and one reason is due to the directory path being exposed. But if it is not too much to ask from you. Could you please edit my first post and just remove the directory path before

    “/wp-content/plugins/content-control/classes/Shortcodes.php on line 69”

    I would appreciate it. Thank you.

    Thread Starter apartmentsforrentx

    (@apartmentsforrentx)

    Additionally I had 7 reported directory traversal hack attempts on my website. So I hope you could grant my request to remove the directory path on my first post. Thank you.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @apartmentsforrentx Stop reporting this topic.

    Again, there is nothing here that us security related. Please do not report this again.

    Those probes happen regardless and if you are concerned then considered hardening your site and/or installing a security plugin.

    https://www.ads-software.com/support/article/hardening-wordpress/

    https://www.ads-software.com/plugins/search/security/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP Error’ is closed to new replies.