mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge pull request #3675 from s9e/ticket/13906
[ticket/13906] Fixed old signatures in post preview * s9e/ticket/13906: [ticket/13906] Renamed test [ticket/13906] Added test [ticket/13906] Fixed old signatures in post preview
This commit is contained in:
commit
beb830df71
2 changed files with 26 additions and 7 deletions
|
@ -1490,14 +1490,11 @@ if (!sizeof($error) && $preview)
|
||||||
// Signature
|
// Signature
|
||||||
if ($post_data['enable_sig'] && $config['allow_sig'] && $preview_signature && $auth->acl_get('f_sigs', $forum_id))
|
if ($post_data['enable_sig'] && $config['allow_sig'] && $preview_signature && $auth->acl_get('f_sigs', $forum_id))
|
||||||
{
|
{
|
||||||
$parse_sig = new parse_message($preview_signature);
|
$flags = ($config['allow_sig_bbcode']) ? OPTION_FLAG_BBCODE : 0;
|
||||||
$parse_sig->bbcode_uid = $preview_signature_uid;
|
$flags |= ($config['allow_sig_links']) ? OPTION_FLAG_LINKS : 0;
|
||||||
$parse_sig->bbcode_bitfield = $preview_signature_bitfield;
|
$flags |= ($config['allow_sig_smilies']) ? OPTION_FLAG_SMILIES : 0;
|
||||||
|
|
||||||
// Not sure about parameters for bbcode/smilies/urls... in signatures
|
$preview_signature = generate_text_for_display($preview_signature, $preview_signature_uid, $preview_signature_bitfield, $flags, false);
|
||||||
$parse_sig->format_display($config['allow_sig_bbcode'], $config['allow_sig_links'], $config['allow_sig_smilies']);
|
|
||||||
$preview_signature = $parse_sig->message;
|
|
||||||
unset($parse_sig);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -180,4 +180,26 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertEquals($text, $crawler->filter('#message')->text());
|
$this->assertEquals($text, $crawler->filter('#message')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_old_signature_in_preview()
|
||||||
|
{
|
||||||
|
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||||
|
SET user_sig = '[b:2u8sdcwb]My signature[/b:2u8sdcwb]',
|
||||||
|
user_sig_bbcode_uid = '2u8sdcwb',
|
||||||
|
user_sig_bbcode_bitfield = 'QA=='
|
||||||
|
WHERE user_id = 2";
|
||||||
|
$this->get_db()->sql_query($sql);
|
||||||
|
|
||||||
|
$this->login();
|
||||||
|
$crawler = self::request('GET', 'posting.php?mode=post&f=2');
|
||||||
|
$form = $crawler->selectButton('Preview')->form(array(
|
||||||
|
'subject' => 'Test subject',
|
||||||
|
'message' => 'My post',
|
||||||
|
));
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
$this->assertContains(
|
||||||
|
'<span style="font-weight: bold">My signature</span>',
|
||||||
|
$crawler->filter('#preview .signature')->html()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue