mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(quotes): resolve external quote links across boards (#1064)
This commit is contained in:
@@ -180,6 +180,12 @@ export const isValidCrossboardPattern = (pattern: string): boolean => {
|
||||
return true; // CID is exactly 46 alphanumeric chars
|
||||
}
|
||||
|
||||
// Check if it's a directory + post number pattern: >>>/biz/123
|
||||
const directoryPostNumberMatch = pathPart.match(/^([a-zA-Z0-9]{1,10})\/(\d+)$/);
|
||||
if (directoryPostNumberMatch) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if it's a full address + thread pattern: >>>/board.eth/fullCid
|
||||
const addressThreadMatch = pathPart.match(/^([^/]+)\/([a-zA-Z0-9]{46})$/);
|
||||
if (addressThreadMatch) {
|
||||
@@ -188,6 +194,13 @@ export const isValidCrossboardPattern = (pattern: string): boolean => {
|
||||
return isValidDomain(address) || isValidIPNSKey(address);
|
||||
}
|
||||
|
||||
// Check if it's a full address + post number pattern: >>>/board.eth/123
|
||||
const addressPostNumberMatch = pathPart.match(/^([^/]+)\/(\d+)$/);
|
||||
if (addressPostNumberMatch) {
|
||||
const [, address] = addressPostNumberMatch;
|
||||
return isValidDomain(address) || isValidIPNSKey(address);
|
||||
}
|
||||
|
||||
// Check if it's just a full address pattern: >>>/board.eth
|
||||
return isValidDomain(pathPart) || isValidIPNSKey(pathPart);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user