Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions new.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ function set_progress( float $pc, string $label ) {
} else {
$patches = [];
}
$initialPatchCount = count( $patches );

set_progress( 0, 'Checking language code...' );

Expand All @@ -178,7 +179,7 @@ function set_progress( float $pc, string $label ) {
$usedRepos = [];

// Iterate by reference, so that we can modify the $patches array to add new entries
foreach ( $patches as &$patch ) {
foreach ( $patches as $i => &$patch ) {
preg_match( '/^(I[0-9a-f]+|(?<r>[0-9]+)(,(?<p>[0-9]+))?)$/', $patch, $matches );
if ( !$matches ) {
$patch = htmlentities( $patch );
Expand Down Expand Up @@ -226,8 +227,15 @@ function set_progress( float $pc, string $label ) {

$repos = get_repo_data();
if ( !isset( $repos[ $repo ] ) ) {
$repo = htmlentities( $repo );
abandon( "Repository <em>$repo</em> not supported" );
$repoHtml = htmlentities( $repo );
if ( $i < $initialPatchCount ) {
// Patch requested by the user, so show an error
abandon( "Repository <em>$repoHtml</em> not supported" );
} else {
// Patch added from 'Depends-On', so we can probably ignore it
warn( "One of your patches depends on a patch from the <em>$repoHtml</em> repository, which is not supported." );
continue;
}
}
$path = $repos[ $repo ];
$usedRepos[] = $repo;
Expand Down