Beispiel #1
0
        }
        if ($found_it == true) {
            array_push($temp_lines, $line);
        }
    }
    return $temp_lines;
}
save_log($ldap, $code_v0, $code_v1, $code_v2);
$lines1 = get_diff_summary($ldap, $passwd, $code_v0, $code_v1, $code_v1_raw);
$lines2 = get_diff_summary($ldap, $passwd, $code_v0, $code_v2, $code_v2_raw);
if ($simple_view == "1") {
    simple_output($lines1, $lines2);
} else {
    if ($same_update_view == "1") {
        $file_list = array();
        foreach (array_keys($lines1) as $file) {
            if (array_key_exists($file, $lines2)) {
                array_push($file_list, $file);
            }
        }
        $lines = get_diff_lines($ldap, $passwd, $code_v0, $code_v1);
        $temp_lines = get_care_lines($lines, $file_list);
        $diffObjList = get_diff($temp_lines);
        $lines2 = get_diff_lines($ldap, $passwd, $code_v0, $code_v2);
        $temp_lines2 = get_care_lines($lines2, $file_list);
        $diffObjList2 = get_diff($temp_lines2);
        output_html_result($diffObjList, "1");
        echo "";
        output_html_result($diffObjList2, "2");
    }
}
Beispiel #2
0
                        if ($old_class != "") {
                            $old_class = "";
                            array_push($diff_content_lines, "<tr class='headline'><th class='index'>{$c1_idx}</th><td><pre><span>{$c1_line}</span></pre></td><th class='index'>{$c2_idx}</th><td><pre><span>{$c2_line}</span></pre></td></tr>");
                        } else {
                            array_push($diff_content_lines, "<tr><th class='index'>{$c1_idx}</th><td><pre><span>{$c1_line}</span></pre></td><th class='index'>{$c2_idx}</th><td><pre><span>{$c2_line}</span></pre></td></tr>");
                        }
                    }
                }
            }
        }
        array_push($diff_content_lines, "</table>\n<br>");
        $index++;
    }
    $url_html_str = implode("\n", $url_html_lines);
    $diff_content_str = implode("\n", $diff_content_lines);
    echo "<div id='filelist' class='content'>\n";
    echo $url_html_str . "\n";
    echo "</div>\n";
    echo "<br>\n";
    echo "<div id='diff_content'>\n";
    echo $diff_content_str . "\n";
    echo "</div>\n";
    echo "<br>\n";
    echo "<div id='filelist2' class='content'>\n";
    echo $url_html_str . "\n";
    echo "</div>\n";
    echo "<br>\n";
}
$lines = get_diff_lines($ldap, $passwd, $url, $version1, $version2);
$diffObjList = get_diff($lines);
output_html_result($diffObjList);
Beispiel #3
0
function get_link_list($diffdata)
{
    $links = array();
    list($plus, $minus) = get_diff_lines($diffdata);
    // Get URLs from <a>(anchor) tag from convert_html()
    $plus = convert_html($plus);
    // WARNING: heavy and may cause side-effect
    preg_match_all('#href="(https?://[^"]+)"#', $plus, $links, PREG_PATTERN_ORDER);
    $links = array_unique($links[1]);
    // Reject from minus list
    if ($minus != '') {
        $links_m = array();
        $minus = convert_html($minus);
        // WARNING: heavy and may cause side-effect
        preg_match_all('#href="(https?://[^"]+)"#', $minus, $links_m, PREG_PATTERN_ORDER);
        $links_m = array_unique($links_m[1]);
        $links = array_diff($links, $links_m);
    }
    unset($plus, $minus);
    // Reject own URL (Pattern _NOT_ started with '$script' and '?')
    $links = preg_grep('/^(?!' . preg_quote(get_script_absuri(), '/') . '\\?)./', $links);
    // No link, END
    if (!is_array($links) || empty($links)) {
        return;
    }
    return $links;
}
Beispiel #4
0
                            array_push($diff_content_lines, "<tr class='headline'><th class='index'>{$c1_idx}</th><td><pre><span>{$c1_line}</span></pre></td><th class='index'>{$c2_idx}</th><td><pre><span>{$c2_line}</span></pre></td></tr>");
                        } else {
                            array_push($diff_content_lines, "<tr><th class='index'>{$c1_idx}</th><td><pre><span>{$c1_line}</span></pre></td><th class='index'>{$c2_idx}</th><td><pre><span>{$c2_line}</span></pre></td></tr>");
                        }
                    }
                }
            }
        }
        array_push($diff_content_lines, "</table>\n<br>");
        $index++;
    }
    // file_put_contents("abc.txt", implode("\n", $temp_array));
    $url_html_str = implode("\n", $url_html_lines);
    $diff_content_str = implode("\n", $diff_content_lines);
    echo "<div id='filelist' class='content'>\n";
    echo $url_html_str . "\n";
    echo "</div>\n";
    echo "<br>\n";
    echo "<div id='diff_content'>\n";
    echo $diff_content_str . "\n";
    echo "</div>\n";
    echo "<br>\n";
    echo "<div id='filelist2' class='content'>\n";
    echo $url_html_str . "\n";
    echo "</div>\n";
    echo "<br>\n";
}
save_log($ldap, $code_v1, $code_v2);
$lines = get_diff_lines($ldap, $passwd, $code_v1, $code_v2);
$diffObjList = get_diff($lines);
output_html_result($diffObjList);