Skip to content

Commit

Permalink
Fix api_get_origin()
Browse files Browse the repository at this point in the history
origin is not only learnpath
  • Loading branch information
jmontoyaa committed Sep 25, 2017
1 parent 66ccac4 commit eb6d2be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main/inc/lib/api.lib.php
Expand Up @@ -7780,11 +7780,9 @@ function convert_double_quote_to_single($in_text)
**/
function api_get_origin()
{
if (isset($_REQUEST['origin'])) {
return $_REQUEST['origin'] === 'learnpath' ? 'learnpath' : '';
}
$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : '';

return '';
return $origin;
}

/**
Expand Down

2 comments on commit eb6d2be

@ywarnier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have a fixed number of possibilities for origin. Are there many different cases right now?

@jmontoyaa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, In the exercise/lp tool.

Example:
a709167#diff-aa5a1e552d83abac5c8afba41ff89172R250

Please sign in to comment.