diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-19 18:36:12 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-19 18:36:12 -0400 |
| commit | 30dc89278674b8bc83b4e44db920a1c7654c7cdd (patch) | |
| tree | 487947167afd971979a75d9a07eba4d81f22dab7 /post.php | |
| parent | 0ba40a8fc2b7e798bf1b93e4f9c2972d3ba3f4cc (diff) | |
Only store video URLs in database, instead of the generated player HTML.
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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; } |
