forked from leftypol/leftypol
Only store video URLs in database, instead of the generated player HTML.
This commit is contained in:
parent
0ba40a8fc2
commit
30dc892786
2 changed files with 33 additions and 13 deletions
17
post.php
17
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue