X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Finstall-inc.php;h=5f9fede1c27f7ed416f8fda48a8aad31897120b3;hb=e0c325d3886bfff13a50a06cfedf9a8da24b2598;hp=9bdd5f39f0393a019483229e2216c65bea1f97e2;hpb=1bf45cc4694aedce0b2fed54090c3f74cc93fe26;p=mailer.git diff --git a/inc/install-inc.php b/inc/install-inc.php index 9bdd5f39f0..5f9fede1c2 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -45,8 +45,9 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0) { // Initialize all and count up the "seak" value $done = false; - $next = 0; + $next = -1; $sneak++; + if ((file_exists($file)) && (is_readable($file))) { $search = "CFG: ".$comment; $tmp = $file.".tmp"; @@ -56,15 +57,22 @@ function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0) if (is_resource($fp_tmp)) { while (!feof($fp)) { $line = fgets ($fp, 10240); - if (strpos($line, $search) > -1) $next = 0; + //* DEBUG: */ echo $search."/".htmlentities($line)."
\n"; + $found = strpos($line, $search); + //* DEBUG: */ echo "FOUND: "; + //* DEBUG: */ var_dump($found); + //* DEBUG: */ echo "
\n"; + if ($found !== false) $next = 0; if ($next > -1) { if ($next == $sneak) { $next = -1; $line = $prefix.$DATA.$suffix."\n"; + //* DEBUG: */ echo "NEW: ".htmlentities($line)."
\n"; } else { $next++; } } + //* DEBUG: */ echo "WRITE: ".htmlentities($line)."
\n"; fputs($fp_tmp, $line); } fclose($fp_tmp);