In version 0.9.1, when you put "#1" in the comments for example, it creates a link to bug #1.
Version 1.04rc4 tries to do the same thing, but all that happens is that you see
<a href=/phpbt/bug.php?op=show&bugid=1>#1</a>
instead of the actual link.
Any clues as to why this is happening?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
after playing around with it some more, i discovered that it does not display html tags at all.
For some reason, it changes "<" to "<" and ">" to ">"
Any way to fix this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is still a problem for me in phpbt 1.0.1 but the bugdisplay.html no longer has this code in it. When I try to add a hyperlink in the comments of a bug I see the actual code and not a hyperlink. In bug.php I found the following code
<a href="'.CVS_WEB.'\\1#rev\\4" target="_new">
which seems to be the problem because I see this in the comment of the bug. Anyone else having this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I changed function format_comments() in /bug.php to sort this out as follows:
/// Beautify the bug comments
function format_comments($comments) {
global $me;
// Set up the regex replacements
// This didn't work as it was hyperlinking bug numbers and then making < and > into < and >
// so I've split the regexp into 2 stages.
$patterns1 = array(
'/</',
'/>/'
);
$replacements1 = array(
'<',
'>'
);
$patterns2 = array(
'/(bug)[[:space:]]*(#?)([0-9]+)/i', // matches bug #nn
'/cvs:([^\.\s:,\?!]+(\.[^\.\s:,\?!]+)*)(:)?(\d\.[\d\.]+)?([\W\s])?/i' // matches cvs:filename.php or cvs:filename.php:n.nn
);
$replacements2 = array(
"\\1 <a href='$me?op=show&bugid=\\3'>\\2\\3</a>", // internal link to bug
'<a href="'.CVS_WEB.'\\1#rev\\4" target="_new">\\1</a>\\5' // external link to cvs web interface
);
In version 0.9.1, when you put "#1" in the comments for example, it creates a link to bug #1.
Version 1.04rc4 tries to do the same thing, but all that happens is that you see
<a href=/phpbt/bug.php?op=show&bugid=1>#1</a>
instead of the actual link.
Any clues as to why this is happening?
after playing around with it some more, i discovered that it does not display html tags at all.
For some reason, it changes "<" to "<" and ">" to ">"
Any way to fix this?
This is still a problem for me in phpbt 1.0.1 but the bugdisplay.html no longer has this code in it. When I try to add a hyperlink in the comments of a bug I see the actual code and not a hyperlink. In bug.php I found the following code
<a href="'.CVS_WEB.'\\1#rev\\4" target="_new">
which seems to be the problem because I see this in the comment of the bug. Anyone else having this problem?
Found the solution...
in bugdisplay.html around line 234, where it says
<td><?php echo stripslashes(htmlspecialchars(format_comments(nl2br($comments[$i]['comment_text'])))); ?><br><br></td>
put
<td><?php echo stripslashes(format_comments(nl2br($comments[$i]['comment_text']))); ?> <br><br></td>
I changed function format_comments() in /bug.php to sort this out as follows:
/// Beautify the bug comments
function format_comments($comments) {
global $me;
// Set up the regex replacements
// This didn't work as it was hyperlinking bug numbers and then making < and > into < and >
// so I've split the regexp into 2 stages.
$patterns1 = array(
'/</',
'/>/'
);
$replacements1 = array(
'<',
'>'
);
$patterns2 = array(
'/(bug)[[:space:]]*(#?)([0-9]+)/i', // matches bug #nn
'/cvs:([^\.\s:,\?!]+(\.[^\.\s:,\?!]+)*)(:)?(\d\.[\d\.]+)?([\W\s])?/i' // matches cvs:filename.php or cvs:filename.php:n.nn
);
$replacements2 = array(
"\\1 <a href='$me?op=show&bugid=\\3'>\\2\\3</a>", // internal link to bug
'<a href="'.CVS_WEB.'\\1#rev\\4" target="_new">\\1</a>\\5' // external link to cvs web interface
);
$replace1 = preg_replace($patterns1, $replacements1, stripslashes($comments));
return nl2br(preg_replace($patterns2, $replacements2, $replace1));
}
Hey Jon, thanks for the code sample. I put this into my bug.php and found that it fixed the hyper link issue that I was seeing. Thanks again.