既に保存されたページのURLの修正
このコミットが含まれているのは:
コミット
c70f0e7a4c
|
@ -3,12 +3,10 @@
|
||||||
$exists = [];
|
$exists = [];
|
||||||
$url = '';
|
$url = '';
|
||||||
|
|
||||||
function archiving ($url) {
|
function geturl (): string {
|
||||||
$p = str_replace('https://', '', $_POST['hozonsite']);
|
$p = str_replace('https://', '', $_POST['hozonsite']);
|
||||||
$p = str_replace('http://', '', $p);
|
$p = str_replace('http://', '', $p);
|
||||||
|
|
||||||
system("cd ".$url." && wget -LpExk --no-check-certificate --max-redirect=3 --default-page=index.html --reject js,json,mp4,mov,mkv,mp3,ogg,ogv ".$_POST['hozonsite']);
|
|
||||||
|
|
||||||
$ex = explode('/', parse_url($_POST['hozonsite'])['path']);
|
$ex = explode('/', parse_url($_POST['hozonsite'])['path']);
|
||||||
$ex = $ex[array_key_last($ex)];
|
$ex = $ex[array_key_last($ex)];
|
||||||
if ($ex == '') $ex = 'index.html';
|
if ($ex == '') $ex = 'index.html';
|
||||||
|
@ -24,7 +22,13 @@
|
||||||
unset($ex);
|
unset($ex);
|
||||||
$basename .= (!str_ends_with($basename, '.html') && !str_ends_with($basename, '.htm') && !str_ends_with($basename, '.xhtml') ? '.html' : '');
|
$basename .= (!str_ends_with($basename, '.html') && !str_ends_with($basename, '.htm') && !str_ends_with($basename, '.xhtml') ? '.html' : '');
|
||||||
|
|
||||||
return $url.'/'.$p.'/'.$basename;
|
return $p.'/'.$basename;
|
||||||
|
}
|
||||||
|
|
||||||
|
function archiving (string $url): string {
|
||||||
|
system("cd ".$url." && wget -LpExk --no-check-certificate --max-redirect=3 --default-page=index.html --reject js,json,mp4,mov,mkv,mp3,ogg,ogv ".$_POST['hozonsite']);
|
||||||
|
|
||||||
|
return $url.'/'.geturl();
|
||||||
}
|
}
|
||||||
|
|
||||||
function striptags (string $text): string {
|
function striptags (string $text): string {
|
||||||
|
@ -77,17 +81,7 @@
|
||||||
$err = 'URLは「http://」又は「https://」で始めます。';
|
$err = 'URLは「http://」又は「https://」で始めます。';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$url = str_replace('https://', '', $_POST['hozonsite']);
|
$url = geturl();
|
||||||
$url = str_replace('http://', '', $url);
|
|
||||||
if (
|
|
||||||
!str_ends_with($url, '.html') &&
|
|
||||||
!str_ends_with($url, '\/') &&
|
|
||||||
!str_ends_with($url, '.htm') &&
|
|
||||||
!str_ends_with($url, '.xhtml') &&
|
|
||||||
!str_ends_with($url, '.php') &&
|
|
||||||
!str_ends_with($url, '.asp') &&
|
|
||||||
!str_ends_with($url, '.aspx')
|
|
||||||
) $url = $url.'*';
|
|
||||||
$fullurl = 'archive/'.time();
|
$fullurl = 'archive/'.time();
|
||||||
$exists = glob('archive/*/'.$url);
|
$exists = glob('archive/*/'.$url);
|
||||||
|
|
||||||
|
|
新しいイシューから参照