Skip to content

Commit

Permalink
Merge pull request #129 from internetarchive/schema-rewrtie
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
cyberpower678 committed Feb 10, 2024
2 parents 857e4e0 + cfa04a5 commit 45830b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions app/src/Core/APII.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ public function __construct( $page, $pageid, $config, $cachedContent = false ) {
* @copyright Copyright (c) 2015-2024, Maximilian Doerr, Internet Archive
* @author Maximilian Doerr (Cyberpower678)
*/
public static function getBatchText( $objects, $objectType = 'pagetitle', &$returnedObjects = [],
$handleTruncation = true
public static function getBatchText( $objects, $objectType = 'pagetitle', &$unhandledObjects = [],
$handleLimitations = true
) {
$returnArray = [];

Expand Down Expand Up @@ -310,9 +310,14 @@ public static function getBatchText( $objects, $objectType = 'pagetitle', &$retu
}
}

$diff = count( $batch ) - count( $objects );

if( isset( $limit ) ) $batch = array_slice( $objects, 0, $limit );
else $batch = $objects;

$unhandledObjects = $objects;

$returnedObjects = $objects;
if( !$handleLimitations && $diff !== 0 ) break;
}

return $returnArray;
Expand Down
2 changes: 1 addition & 1 deletion app/src/Core/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ public static function generateLogReport() {
public function logScanResults( $urlID, $isDead, $ip, $hostname, $httpCode, $curlInfo, $error = '' ) {
$sql =
"INSERT INTO " . SECONDARYDB . ".externallinks_scan_log (`url_id`,`scanned_dead`,`host_machine`,`external_ip`,`reported_code`,`reported_error`,`request_data`) VALUES ( $urlID," .
( is_null( $isDead ) ? 2 : (int)(bool)$isDead ) . ", '$hostname', '$ip', $httpCode, " . ( empty( $error
( is_null( $isDead ) ? 2 : (int)(bool)$isDead ) . ", '$hostname', '$ip', " . ( is_null( $httpCode ) ? 0 : $httpCode ) . ", " . ( empty( $error
) ? "NULL" : "'$error'" ) .
", '" .
mysqli_escape_string( self::$db, serialize( $curlInfo ) ) . "' );";
Expand Down

0 comments on commit 45830b1

Please sign in to comment.