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

[Issue] Expression syntax error with single quote #9396

Closed
2 tasks done
ConnorWorrell opened this issue Apr 26, 2023 · 5 comments
Closed
2 tasks done

[Issue] Expression syntax error with single quote #9396

ConnorWorrell opened this issue Apr 26, 2023 · 5 comments
Labels
Status: Confirmed The issue was confirmed by others Topic: Expressions Type: Bug This issue or PR is related to a bug

Comments

@ConnorWorrell
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Forums discussion

No response

Version

0.20 (Release)

Full version info

[code]
OS: Arch Linux (sway)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git)
Build type: Release
Branch: makepkg
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.9, Qt 5.15.8, Coin 4.0.1, Vtk 9.2.6, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * dodo
[/code]

Subproject(s) affected?

Core

Issue description

Expressions using single quotes throw error when clicking OK.

Steps to reproduce:

  1. Open any formula editor
  2. Input 1'
  3. Click ok
  4. Error

<class 'SyntaxError'>: ('unterminated string literal (detected at line 1)', ('<string>', 1, 75, "App.getDocument('Unnamed').Sketch.setExpression('.Placement.Base.x', u'1 '')", 1, 75))

It appears these single quotes are not being properly escaped.

Potential for injection: 1') or print('jfdkls

Putting this here since this link seems dead:
https://github.com/FreeCAD/FreeCAD/security/advisories/new

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@luzpaz luzpaz added the Status: Needs test on dev version Missing test on the weekly version label Jun 26, 2023
@luzpaz
Copy link
Contributor

luzpaz commented Jun 26, 2023

@ConnorWorrell can you test on dev version please ?

@ConnorWorrell
Copy link
Contributor Author

Tested on master branch shows same error with same steps to reproduce.

OS: Arch Linux (sway)
Word size of FreeCAD: 64-bit
Version: 0.21.0.33458 (Git)
Build type: Unknown
Branch: master
Hash: 8b89dd29d2382c72d738c52e8974216130ffa9db
Python 3.11.3, Qt 5.15.9, Coin 4.0.1, Vtk 9.2.6, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * dodo

<class 'SyntaxError'>: ('unterminated string literal (detected at line 1)', ('<string>', 1, 72, "App.getDocument('Unnamed').Sketch.setExpression('Constraints[0]', u'1 '')", 1, 72))

@Roy-043 Roy-043 added Type: Bug This issue or PR is related to a bug Topic: Expressions and removed Status: Needs test on dev version Missing test on the weekly version labels Jul 15, 2023
@Roy-043
Copy link
Contributor

Roy-043 commented Jul 15, 2023

Confirmed. You can however enter 1ft instead. Note that if you enter 1' the error that is indicated (red text and tooltip if you hover the fx icon) goes away if you click in another field for example.

Copy link

Hi! This issue hasn’t seen activity in a while. We automatically check each issue after 190 days without activity to keep the backlog tidy.
If it’s still relevant, please update to the latest FreeCAD weekly build download here to see if the issue is already resolved.

If the issue is still relevant, let us know by adding a comment.
Otherwise, we’ll close this issue automatically in 60 days.

Feel free to comment anytime to keep it open. Closed issues can always be reopened.
Thanks for helping improve FreeCAD!

Access additional FreeCAD resources:

@github-actions github-actions bot added the Status: Stale Stale and might be closed automatically. label Dec 30, 2024
@Roy-043
Copy link
Contributor

Roy-043 commented Jan 2, 2025

This has been fixed.

OS: Windows 8 build 9600
Architecture: x86_64
Version: 1.1.0dev.39673 (Git) Conda
Build type: Release
Branch: main
Hash: 1289997dfd604cb24f060f905f04ec3728d964e4
Python 3.11.11, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1
Locale: C/Default (C) [ OS: Dutch/Netherlands (nl_NL) ]
Stylesheet/Theme/QtStyle: unset/FreeCAD Classic/Qt default
Installed mods:

@Roy-043 Roy-043 closed this as completed Jan 2, 2025
@Roy-043 Roy-043 removed the Status: Stale Stale and might be closed automatically. label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Confirmed The issue was confirmed by others Topic: Expressions Type: Bug This issue or PR is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants