Skip to content

Commit

Permalink
connector_woocommerce: fix unsafe eval
Browse files Browse the repository at this point in the history
  • Loading branch information
gurneyalex authored and cubells committed Feb 3, 2021
1 parent 70537c1 commit daf437f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion connector_woocommerce/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

{
'name': 'WooCommerce Connector',
'version': '8.0.1.0.0',
'version': '8.0.1.0.1',
'category': 'customized',
'description': """WooCommerce Connector.""",
'author': 'Tech Receptives',
Expand Down
7 changes: 5 additions & 2 deletions connector_woocommerce/unit/backend_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
import logging
import xmlrpclib
from woocommerce import API

from openerp.addons.connector.unit.backend_adapter import CRUDAdapter
from openerp.addons.connector.exception import (NetworkRetryableError,
RetryableJobError)
from openerp.tools.safe_eval import safe_eval

from datetime import datetime
_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -146,9 +149,9 @@ def _call(self, method, arguments):
'false', 'False')
result = result.replace('true', 'True')
result = result.replace('null', 'False')
result = eval(result)
result = safe_eval(result)
else:
result = eval(api.get(method).content)
result = safe_eval(api.get(method).content)
except:
_logger.error("api.call(%s, %s) failed", method, arguments)
raise
Expand Down

0 comments on commit daf437f

Please sign in to comment.