From 30dc89278674b8bc83b4e44db920a1c7654c7cdd Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Fri, 19 Jul 2013 18:36:12 -0400 Subject: Only store video URLs in database, instead of the generated player HTML. --- post.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'post.php') diff --git a/post.php b/post.php index 30db27b9..4e10c0cf 100644 --- a/post.php +++ b/post.php @@ -243,19 +243,10 @@ if (isset($_POST['delete'])) { // yep; validate it $value = $_POST['embed']; foreach ($config['embedding'] as &$embed) { - if ($html = preg_replace($embed[0], $embed[1], $value)) { - if ($html == $value) { - // Nope. - continue; - } - - // Width and height - $html = str_replace('%%tb_width%%', $config['embed_width'], $html); - $html = str_replace('%%tb_height%%', $config['embed_height'], $html); - - // Validated. It works. - $post['embed'] = $html; - // This looks messy right now, I know. I'll work on a better alternative later. + if (preg_match($embed[0], $value)) { + // Valid link + $post['embed'] = $value; + // This is bad, lol. $post['no_longer_require_an_image_for_op'] = true; break; } -- cgit v1.3