- 
                Notifications
    
You must be signed in to change notification settings  - Fork 17
 
IBX-9217: Added URL validation #1418
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, this will approve all valid URLs no matter the protocol. If we later want to introduce an FT setting to only allow certain protocols, we can support that here by checking the url protocol property.
          
 In this implementation, I’m checking if string is a valid url, no matter what the protocol is, as long as it is actually a protocol :) but we can later add additional protocol validation via property  
  | 
    
79e777a    to
    8a32b7e      
    Compare
  
    | 
               | 
          ||
| if (!isEmpty) { | ||
| try { | ||
| new URL(urlValue); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of doing this whole try catch you can do normal if using static method canParse https://developer.mozilla.org/en-US/docs/Web/API/URL/canParse_static
7142014    to
    c768afb      
    Compare
  
    5ad899b    to
    c768afb      
    Compare
  
    c768afb    to
    2153682      
    Compare
  
    2153682    to
    9ff1f74      
    Compare
  
    | 
           @OstafinL 2025-03-05_10-34-36.mp4nothing happens, see recording.  | 
    
9ff1f74    to
    82a9d92      
    Compare
  
    | 
           QA Approved on Ibexa DXP Commerce 4.6.x-dev and 4.6.17.  | 
    
82a9d92    to
    0cbce5a      
    Compare
  
    0cbce5a    to
    02e3ec3      
    Compare
  
    
          
 | 
    



Description:
It is base validation without escaping because IBX-8962 ibexa/fieldtype-richtext#202
For QA:
Ad. 9e00eb2 / 5ad899b
In the end modified scenarios for variants in https://github.com/ibexa/product-catalog/pull/1251
Added retrying (and mouse over) for switching field groupsdue to random error encountered on Chrome v124 on Headless:https://github.com/ibexa/headless/actions/runs/13391931955/job/37401422810#step:18:215
https://res.cloudinary.com/ezplatformtravis/image/upload/v1739887300/screenshots/67b492c43b022776389969-vendor_ibexa_product-catalog_features_browser_productvariants_feature_165_whc2qm.png
In this PR tests fail because Chrome 110 is used (without support for
canParse).Tests with Chrome 124 are run ibexa/commerce#1186, ibexa/experience#520, ibexa/headless#190, ibexa/oss#201.
Documentation: