Advertisement:

Author Topic: [5000] Bug in code tag  (Read 3112 times)

Offline Akyhne

  • SMF Hero
  • ******
  • Posts: 7,373
  • Gender: Male
[5000] Bug in code tag
« on: August 14, 2012, 07:10:07 AM »
Code: [Select]
echo ' »';
« Last Edit: August 18, 2012, 06:10:02 AM by emanuele »
Don't PM me about translations. I'm not a team member any more!

Offline Akyhne

  • SMF Hero
  • ******
  • Posts: 7,373
  • Gender: Male
Re: Bug in code tag
« Reply #1 on: August 14, 2012, 07:10:44 AM »
Code: [Select]
foreach ($context['linktree'] as $link_num => $tree)
{
if (isset($board_info['cat']) && $tree['name'] !== $board_info['cat']['name'] || !isset($board_info['cat']))
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' »';

echo '
</li>';
}
}
Don't PM me about translations. I'm not a team member any more!

Offline Akyhne

  • SMF Hero
  • ******
  • Posts: 7,373
  • Gender: Male
Re: Bug in code tag
« Reply #2 on: August 14, 2012, 07:12:07 AM »
Code: [Select]
foreach ($context['linktree'] as $link_num => $tree)
{
if (isset($board_info['cat']) && $tree['name'] !== $board_info['cat']['name'] || !isset($board_info['cat']))
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' &#187;';

echo '
</li>';
}
}
Don't PM me about translations. I'm not a team member any more!

Offline Akyhne

  • SMF Hero
  • ******
  • Posts: 7,373
  • Gender: Male
Re: Bug in code tag
« Reply #3 on: August 14, 2012, 07:14:16 AM »
Hmm, if you look at the code above, there's a difference. When posting the code example from quick reply, the part echo echo ' & # 1 8 7;'; gets replaced with echo ' »';
If you post from the reply window, it is saved as is.

I scream bug!
Don't PM me about translations. I'm not a team member any more!

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,869
  • Gender: Male
  • Because Orange is Orange
Re: Bug in code tag
« Reply #4 on: August 17, 2012, 11:35:07 AM »
Code: [Select]
echo ' »';quickreply

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,869
  • Gender: Male
  • Because Orange is Orange
Re: Bug in code tag
« Reply #5 on: August 17, 2012, 11:35:25 AM »
Code: [Select]
echo ' &#187;';post page

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,869
  • Gender: Male
  • Because Orange is Orange
Re: Bug in code tag
« Reply #6 on: August 17, 2012, 11:37:38 AM »
echo ' &#187;';

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,869
  • Gender: Male
  • Because Orange is Orange
Re: Bug in code tag
« Reply #7 on: August 17, 2012, 12:04:48 PM »
Okay, at the moment inconsistency is not a problem in 2.1: in both cases the code is converted to ». :P

Now back to the issue. The cause is smc_saveEntities.
This javascript function is used to:
Code: [Select]
value.replace(/&#/g, '&#');in every element of the form posted...from the editor, not from the quick reply because the quick reply doesn't use the editor.

Now, my question is: is there any advantage doing this replacement client-side instead of server-side?
Probably the fact that client-side we should know which fields must be processed?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Akyhne

  • SMF Hero
  • ******
  • Posts: 7,373
  • Gender: Male
Re: Bug in code tag
« Reply #8 on: August 17, 2012, 01:26:03 PM »
FYI, I tracked this one: http://dev.simplemachines.org/mantis/view.php?id=5000

EDIT: Ooh, bug no 5000. Is that a good thing or a bad one, lol
Don't PM me about translations. I'm not a team member any more!

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,869
  • Gender: Male
  • Because Orange is Orange
Re: Bug in code tag
« Reply #9 on: August 17, 2012, 02:15:12 PM »
I know, but I prefer discuss things here for two reasons:
1) everybody can help here,
2) I still don't know how to post highlighted code with mantis.

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,869
  • Gender: Male
  • Because Orange is Orange

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.