Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle escaped * and $ characters in RobotsServer #458

Open
Mideen opened this issue Dec 22, 2020 · 0 comments
Open

Handle escaped * and $ characters in RobotsServer #458

Mideen opened this issue Dec 22, 2020 · 0 comments

Comments

@Mideen
Copy link

Mideen commented Dec 22, 2020

In PathRule.java, Crawler4j handled to escape the *,$ special chars.

if (ch == '\') {
// Handle escaped * and $ characters
char nch = pos < pattern.length() - 1 ? pattern.charAt(pos + 1) : 0;
if (nch == '*' || ch == '$') {
quoteBuf.append(nch);
++pos; // We need to skip one character
} else {
quoteBuf.append(ch);
}
}

Here " nch == '' || ch == '$' " should be " nch == '' || nch == '$' " right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant