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

Projects
None yet
2 participants
@flodolo
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@pascalchevrel

pascalchevrel Jul 8, 2014

Member

I guess it's a good tradeoff

Member

pascalchevrel commented Jul 8, 2014

I guess it's a good tradeoff

pascalchevrel added a commit that referenced this pull request Jul 8, 2014

Merge pull request #316 from flodolo/issue315
Improve variable detection in checkvariables.php

@pascalchevrel pascalchevrel merged commit 1c7c714 into mozfr:master Jul 8, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@flodolo flodolo deleted the flodolo:issue315 branch Jul 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment