diff --git a/app/src/Core/parse.php b/app/src/Core/parse.php index 57a0b5ab..43f90cf4 100644 --- a/app/src/Core/parse.php +++ b/app/src/Core/parse.php @@ -316,7 +316,7 @@ public function analyzePage( &$modifiedLinks = [], $webRequest = false, &$editEr ) { //Populate URLs to submit for archiving. if( $i == 1 ) { - $toArchive["$tid:$id"] = $link['url']; + if( !isset( $link['malformed_url'] ) ) $toArchive["$tid:$id"] = $link['url']; } else { //If it archived, then tally the success, otherwise, note it. if( $archiveResponse["$tid:$id"] === true ) { @@ -331,7 +331,7 @@ public function analyzePage( &$modifiedLinks = [], $webRequest = false, &$editEr ) { //Populate URLs to submit for archiving. if( $i == 1 ) { - $toArchive[$tid] = $link['url']; + if( !isset( $link['malformed_url'] ) ) $toArchive[$tid] = $link['url']; } else { //If it archived, then tally the success, otherwise, note it. if( $archiveResponse[$tid] === true ) { @@ -2390,6 +2390,10 @@ public function getLinkDetails( $linkString, $remainder ) { unset( $returnArray['original_url'] ); } + if( empty( strtolower( parse_url( $this->deadCheck->sanitizeURL( $returnArray['url'] ), PHP_URL_SCHEME ) ) ) ) { + $returnArray['malformed_url'] = true; + } + if( isset( $returnArray['archive_template'] ) ) { if( isset( $returnArray['archive_template']['parameters']['__FORMAT__'] ) ) { $returnArray['archive_template']['format'] =