Permalink
Browse files

Fix preg match when a media have a simple/double quotes on this title…

…, also manage URL with any sort of quotes
  • Loading branch information...
1 parent b3b2f4d commit 7e32edc3ce179c7fc4285c31cc957c75da632d82 @herewithme herewithme committed Sep 5, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 wp-content/wpalchemy/MediaAccess.php
@@ -5,7 +5,7 @@
* @copyright Copyright (c) 2011, Dimas Begunoff, http://farinspace.com/
* @license http://en.wikipedia.org/wiki/MIT_License The MIT License
* @package WPAlchemy
- * @version 0.2
+ * @version 0.2.1
* @link http://github.com/farinspace/wpalchemy/
* @link http://farinspace.com/
*/
@@ -332,10 +332,10 @@ public function init()
if (wpalchemy_mediafield)
{
- var src = html.match(/src="(.*)" alt=/i);
+ var src = html.match(/src=['|"](.*?)['|"] alt=/i);
src = (src && src[1]) ? src[1] : '' ;
- var href = html.match(/href='(.*)'/i);
+ var href = html.match(/href=['|"](.*?)['|"]/i);
href = (href && href[1]) ? href[1] : '' ;
var url = src ? src : href ;

0 comments on commit 7e32edc

Please sign in to comment.