News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Bug in VirtueMartModelState getStateByCode (Rev 5074)

Started by Stephen Roberts, December 14, 2011, 21:52:01 PM

Previous topic - Next topic

Stephen Roberts

I believe there's a bug in the state model's getStateByCode() function. The $code variable is being treated as an int in the query:

$query = 'SELECT * FROM `#__virtuemart_states` WHERE `' . $stateCodeFieldname . '` = ' (int)$code;

If I understand the function properly, the code should be treated as a 2 or 3 character string.
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

Interesting,. on the other side, this code is never called. So I just deleted it. I think it was done while we add the security stuff in the summer. Thx
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Stephen Roberts

Gotcha. It was almost identical to getStateIDByName() in shopfunctions.
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com