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

Improve variable detection in checkvariables.php #316

Merged
merged 1 commit into from Jul 8, 2014

Conversation

flodolo
Copy link
Collaborator

@flodolo flodolo commented Jul 8, 2014

/%([0-9]+\$){0,1}S/i

This also detects %s or %S.
pro: you can find more errors (example for cs).
neg: more false positives. Code now reports a mismatch between %S and %s, and %S and %1$S, and both are correct. The alternative is to put more logic in the class

/(?<!%[0-9])\$[a-z0-9\.]+\b/i

This now matches only "brandshortname" in "test brandshortname.". Negative lookbehind is used to avoid some false positive, example My%1$SFeeds-%2$S.opml.

@pascalchevrel
Copy link
Member

I guess it's a good tradeoff

pascalchevrel added a commit that referenced this pull request Jul 8, 2014
Improve variable detection in checkvariables.php
@pascalchevrel pascalchevrel merged commit 1c7c714 into mozfr:master Jul 8, 2014
@flodolo flodolo deleted the issue315 branch July 18, 2014 16:11
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

Successfully merging this pull request may close these issues.

None yet

2 participants