WordPress.org

Ready to get started?Download WordPress

Forums

NS Cloner - Site Copier
[resolved] Some problem with replace array (2 posts)

  1. hanbr
    Member
    Posted 4 months ago #

    Hi!

    Thanks for keeping this plugin updated!

    Though, I noticed some problem with the replace array. When cloning a site I get a lot of this errors:

    [08-Dec-2013 01:18:01 UTC] PHP Notice:  Undefined offset: 2 in /storage/content/19/179819/dinbrfsida.se/public_html/dev/wp-content/plugins/ns-cloner-site-copier/ns-cloner.php on line 1058
    [08-Dec-2013 01:18:01 UTC] PHP Notice:  Undefined offset: 3 in /storage/content/19/179819/dinbrfsida.se/public_html/dev/wp-content/plugins/ns-cloner-site-copier/ns-cloner.php on line 1058
    [08-Dec-2013 01:18:01 UTC] PHP Notice:  Undefined offset: 4 in /storage/content/19/179819/dinbrfsida.se/public_html/dev/wp-content/plugins/ns-cloner-site-copier/ns-cloner.php on line 1058

    ...

    I noticed that the $j variable used on line 1058 is increased inside this loop:

    foreach( $replace_array as $search_for => $replace_with) {
    
        $j++;
        ....

    Is that correct? Shouldn't it be increased outside this loop?

    Br,
    Hans

    http://wordpress.org/plugins/ns-cloner-site-copier/

  2. Never Settle
    Member
    Plugin Author

    Posted 4 months ago #

    Good eye and thanks for bringing that to our attention Hans! Sincerely appreciate your continued contribution.

    The plugin has been updated with fixes for both issues (PHP Notice and $j increment in the wrong place) as you suggest.

Reply

You must log in to post.

About this Plugin

About this Topic