Skip to content

Commit

Permalink
Encoding fix for Speech provider; branch-alias in composer [iet:949…
Browse files Browse the repository at this point in the history
…9314]

* IET-OU/open-media-player#89
[ci skip]
  • Loading branch information
nfreear committed Jul 18, 2017
1 parent d9d1eb1 commit a921dd4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"preferred-install": "dist"
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
},
"//": [
"https://gist.github.com/nfreear/57262e040d49b2f212ec"
]
Expand Down
14 changes: 10 additions & 4 deletions lib/URN_Speech_Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public function call($url, $matches)

// Generate the embed URL from the input URL.
$embed_url = strtr(self::EMBED_URL, [
'{version}' => self::VERSION,
'{text}' => $text,
'{lang}' => $lang ? $lang : '',
'{mode}' => $mode ? $mode : 'speak',
'{version}' => self::getVersion(),
'{text}' => urlencode($text),
'{lang}' => urlencode($lang ? $lang : ''),
'{mode}' => urlencode($mode ? $mode : 'speak'),
]);

$meta = $this->getIframeResponse($url);
Expand All @@ -64,4 +64,10 @@ public function call($url, $matches)

return $meta;
}

protected static function getVersion()
{
$version = config_item('speech_provider_version');
return $version ? $version : self::VERSION;
}
}

0 comments on commit a921dd4

Please sign in to comment.