mirror of
https://github.com/bckelley/avogadrio.git
synced 2026-08-24 02:04:11 -05:00
Handle spaces in URLs safely
This commit is contained in:
@@ -51,10 +51,10 @@ class MoleculeRenderer
|
||||
{
|
||||
// Proxy into Sourire for molecule render.
|
||||
$img = Image::make($this->sourireUrl
|
||||
. 'molecule/' . urlencode($smiles)
|
||||
. 'molecule/' . rawurlencode($smiles)
|
||||
. '?render-stereo-style=' . ($this->renderChiralLabels ? 'old' : 'none') // Label chiral atoms?
|
||||
. '&render-comment-offset=16' // Give some space between label and molecule.
|
||||
. ($this->customLabel === '' ? '' : ('&render-comment=' . urlencode($this->customLabel))));
|
||||
. ($this->customLabel === '' ? '' : ('&render-comment=' . rawurlencode($this->customLabel))));
|
||||
|
||||
// Colorize molecule.
|
||||
list($r, $g, $b) = sscanf($color, "%02x%02x%02x");
|
||||
|
||||
@@ -48,7 +48,7 @@ class SmilesConverter
|
||||
public function nameToSmiles($name)
|
||||
{
|
||||
// Sanitize name for URLs.
|
||||
$encoded = urlencode($name);
|
||||
$encoded = rawurlencode($name);
|
||||
|
||||
// Check if we've got the name cached already.
|
||||
if ($this->isCacheEnabled()) {
|
||||
|
||||
@@ -34,7 +34,7 @@ $(document).ready ->
|
||||
# Gets the sanitized compound name as entered by the user.
|
||||
#
|
||||
getCompoundName = ->
|
||||
encodeURIComponent compoundTextBox.val().replace(/\s/g, '')
|
||||
encodeURIComponent compoundTextBox.val()
|
||||
|
||||
# Gets the sanitized compound SMILES structure as entered by the user.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user