} $diff = array_diff_key($diff, $diff2); if (current($diff)) { $temp = new Diff(); $temp->uid = $_SESSION['uid']; $temp->sid = $s->sid; $temp->comment = $comment; $temp->toreplace = $source2[key($diff) - 1]; $temp->ip = $ip; $temp->rating = $rating; $temp->replacewith = $source2[key($diff) - 1] . "\n" . $nsource[key($diff)]; $temp->commitChanges(); } while (next($diff)) { $temp = new Diff(); $temp->sid = $s->sid; $temp->comment = $comment; $temp->uid = $_SESSION['uid']; $temp->toreplace = $source2[key($diff) - 1]; $temp->ip = $ip; $temp->rating = $rating; $temp->replacewith = $source2[key($diff) - 1] . "\n" . $nsource[key($diff)]; $temp->commitChanges(); } ?> <html> <body onload="window.close();"> </body> </html>