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

Uniqid Generierung #1721

Closed
Mynyx opened this issue Oct 12, 2016 · 2 comments
Closed

Uniqid Generierung #1721

Mynyx opened this issue Oct 12, 2016 · 2 comments
Labels
Milestone

Comments

@Mynyx
Copy link

Mynyx commented Oct 12, 2016

Die Uniqid Generierung für Warenkörbe kann zu Fehlern führen, da mitunter mehrfach die gleiche Uniqid generiert wird, wenn das Cookie nicht angenommen wird.
https://github.com/isotope/core/blob/master/system/modules/isotope/library/Isotope/Model/ProductCollection/Cart.php#L287-L292

Mit einer zufällig generierten Uniqid (z. B. md5(uniqid(mt_rand(), true))) würde das Problem vermieden werden.

PHP Fatal error: Uncaught exception 'Exception' with message 'Query error: Duplicate entry 'fb16997ce93be08e393f9aa74c785867684f1e4f' for key 'uniqid' (INSERT INTO tl_iso_product_collection (type, uniqid, tstamp, member, config_id, store_id) VALUES ('cart', 'fb16997ce93be08e393f9aa74c785867684f1e4f', 1474446272, 0, '1', 0))' thrown in /www/htdocs/xxx/contao/system/modules/core/library/Contao/Database/Statement.php on line 295
#0 /www/htdocs/xxx/contao/system/modules/core/library/Contao/Database/Statement.php(264): Contao\Database\Statement->query()
#1 /www/htdocs/xxx/contao/system/modules/core/library/Contao/Model.php(506): Contao\Database\Statement->execute()
#2 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Model/ProductCollection.php(509): Contao\Model->save()
#3 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Model/ProductCollection.php(911): Isotope\Model\ProductCollection->save()
#4 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Frontend.php(92): Isotope\Model\ProductCollection->addProduct(Object(Isotope\Model\Product\Standard), 1, Array)
#5 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Model/Product/Standard.php(671): Isotope\Frontend->addToCart(Object(Isotope\Model\Product\Standard), Array)
#6 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Module/ProductReader.php(114): Isotope\Model\Product\Standard->generate(Array)
#7 /www/htdocs/xxx/contao/system/modules/core/modules/Module.php(287): Isotope\Module\ProductReader->compile()
#8 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Module/Module.php(112): Contao\Module->generate()
#9 /www/htdocs/xxx/contao/system/modules/isotope/library/Isotope/Module/ProductReader.php(74): Isotope\Module\Module->generate()
#10 /www/htdocs/xxx/contao/system/modules/core/library/Contao/Controller.php(321): Isotope\Module\ProductReader->generate()
#11 /www/htdocs/xxx/contao/system/modules/core/pages/PageRegular.php(133): Contao\Controller::getFrontendModule(Object(Contao\ModuleModel), 'main')
#12 /www/htdocs/xxx/contao/system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
#13 /www/htdocs/xxx/contao/index.php(20): Contao\FrontendIndex->run()
#14 {main}

Bei der Gelegenheit könnte man die Uniqid Generierung für Bestellungen ggf. auch anpassen um die Sicherheit zu erhöhen.
https://github.com/isotope/core/blob/master/system/modules/isotope/library/Isotope/Model/ProductCollection.php#L1609

@aschempp aschempp added the bug label Oct 31, 2016
@aschempp aschempp added this to the 2.4.0 milestone Oct 31, 2016
@aschempp
Copy link
Member

was meinst du mit "Sicherheit erhöhen"?

@aschempp
Copy link
Member

Fixed in e242f29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants