Previous Thread
Next Thread
Print Thread
Hop To
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.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
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:
Code
<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:
Code
<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>


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
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:
Code
$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:
Code
$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);


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
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.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: May 2006
Posts: 3
P
stranger
stranger
P Offline
Joined: May 2006
Posts: 3
function undo_markup:
Code
 
// 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

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
2 members (Nightcrawler, Ruben), 694 guests, and 214 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)