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

Fixed: escape '/' in preg_quote of asset tag prefix #16542

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrdahbi
Copy link

@mrdahbi mrdahbi commented Mar 20, 2025

This resolves the issue I encountered in version 8 of snipe-it (8.0.4)

When using a prefix with forward slash, preg_quote without arguments fails to escape it and results in error in Javascript console while trying for example to create a new asset.

Here's the original error:
missing after parenthesis Uncaught SyntaxError: missing ) source: create:1303:64
which points to the same line fixed in edit.blade.php

When using a prefix with forward slash, preg_quote without arguments fails to escape it and results in error in javascript console while trying for example to create a new asset.
@mrdahbi mrdahbi requested a review from snipe as a code owner March 20, 2025 12:28
Copy link

welcome bot commented Mar 20, 2025

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link

what-the-diff bot commented Mar 20, 2025

PR Summary

  • Improved JavaScript Function Accuracy
    The update to the JavaScript function allows it to process additional information, improving the accuracy of its tasks. The specific change involves the addition of a second parameter in a technical process called preg_quote, ensuring any automatically added prefixes are properly recognized and handled. This means our software will behave more predictably and cleanly when dealing with sequences generated by the system.

@mrdahbi mrdahbi changed the title Update edit.blade.php: escape '/' in preg_quote Fixed: escape '/' in preg_quote of asset tag prefix Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant