|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
If someone use the ubb img tag in his signature threads convert it to img src but without selfclosing /> on its end. This gives a verify error in W3C Markup Validation Service.
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
and another one: ubbthreads/templates/default/showflat.tmpl. there is a missing close ancor tag and the # is too much. found in line 156: <a name="#{$postrow[$i]['Number']}">#<span id="number$i">{$postrow[$i]['Number']}</span> - {$postrow[$i]['time']} <i>{$postrow[$i]['IP']}</i> {$postrow[$i]['filelink']} should be: <a name="{$postrow[$i]['Number']}">#<span id="number$i">{$postrow[$i]['Number']}</span> - {$postrow[$i]['time']} <i>{$postrow[$i]['IP']}</i> {$postrow[$i]['filelink']}</a>
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
I found the xhtml bug for the missing selfclosing tag: in /ubbthreads/ubbt.inc.php line 806: $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)\.(gif|jpg|png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i","<img src=\"http\\2.\\3\">",$Body); should be: $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)\.(gif|jpg|png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i","<img src=\"http\\2.\\3\" alt=\"\" />",$Body);
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
mmhh, this fix the bug for the first time, but a new problem comes up. If I change the preg_replace ubb code for img got converted to html if I edit the post and if you try to submit this edit and html is off in this board the image is gone and text will be displayed.
How does this work? There must be another place to change a bit of code to solve this.
|
|
|
|
Joined: May 2006
Posts: 3
stranger
|
stranger
Joined: May 2006
Posts: 3 |
function undo_markup:
// Convert image markup
if ($config['allowimages'] || ($config['sigimage'] && $type=="sig")) {
$Body = preg_replace("/<img src=\"([^\>]*)\">/i","[{$ubbt_lang['TEXT_IMAGE']}]\\1[/{$ubbt_lang['TEXT_IMAGE']}]",$Body);
}
Kind regards, PaNTerSan
|
|
|
1 members (Gizmo),
327
guests, and
126
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|
|