Skip to content
Snippets Groups Projects
Commit d75d742f authored by Lucas García's avatar Lucas García
Browse files

feat: increase relative endpoints constructor reliability

parent 88e74891
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ function wpct_oc_post_odoo($data, $endpoint)
if (isset($url['scheme'])) {
$post_url = $endpoint;
} else {
$post_url = wpct_oc_get_odoo_base_url() . $endpoint;
$post_url = preg_replace('/\/$/', '', wpct_oc_get_odoo_base_url()) . '/' . preg_replace('/^\//', '', $endpoint);
}
$post_data = json_encode($data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment