summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-19 18:36:12 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-19 18:36:12 -0400
commit30dc89278674b8bc83b4e44db920a1c7654c7cdd (patch)
tree487947167afd971979a75d9a07eba4d81f22dab7 /post.php
parent0ba40a8fc2b7e798bf1b93e4f9c2972d3ba3f4cc (diff)
Only store video URLs in database, instead of the generated player HTML.
Diffstat (limited to 'post.php')
-rw-r--r--post.php17
1 files changed, 4 insertions, 13 deletions
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;
}