Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • stacks stacks
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 173
    • Issues 173
    • List
    • Boards
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • YourHeadYourHead
  • stacksstacks
  • Issues
  • #591
Closed
Open
Issue created Oct 20, 2020 by Isaiah Carew@isaiahcarew☕Owner

preprocessor expression evaluation differs from non-preprocessor

shis is a case where stack api expressions are accidentally picked out of compressed javascript. this only really pops out as a potential bug in that the old expression parser didn't pick these up AND the modulo operator % and parentheses are commonly found in complex math expressions.

this makes for some templates that posed no problems in prior versions, failing in Stacks v4.1 when the preprocessor is used in published content.

here are two simple examples that make it relatively easy to see the problem in action.

   | ---------------------------------------------------------------------------------|
   | a!==a%(h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*h)%h-(0 |
   | a!==a% h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*h %h-(0 |
   | ---------------------------------------------------------------------------------|

   |----------------------------------------------------------------------------------|
   | =r,a!==a%(r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexOf("_cw")&&0>a?a=(a+99999*r)%r-(0a/ |
   | =r,a!==a% r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexOf("_cw")&&0>a?a=(a+99999*r %r-(0a/ |
   |----------------------------------------------------------------------------------|
Assignee
Assign to
Time tracking