@@ -401,35 +401,54 @@ function string_process_bugnote_link( $p_string, $p_include_anchor = true, $p_de
401
401
402
402
if ( !isset ( $ string_process_bugnote_link_callback [$ p_include_anchor ][$ p_detail_info ][$ p_fqdn ] ) ) {
403
403
if ( $ p_include_anchor ) {
404
- $ string_process_bugnote_link_callback [$ p_include_anchor ][$ p_detail_info ][$ p_fqdn ] = create_function ( '$p_array ' , '
405
- if ( bugnote_exists( (int)$p_array[2] ) ) {
406
- $t_bug_id = bugnote_get_field( (int)$p_array[2], \'bug_id \' );
407
- $g_project_override = bug_get_field( $t_bug_id, \'project_id \' );
408
- if ( bug_exists( $t_bug_id ) && ( access_compare_level( user_get_access_level( auth_get_current_user_id(), bug_get_field( $t_bug_id, \'project_id \' ) ), config_get( \'private_bugnote_threshold \' ) ) || ( bugnote_get_field( (int)$p_array[2], \'reporter_id \' ) == auth_get_current_user_id() ) || bugnote_get_field( (int)$p_array[2], \'view_state \' ) == VS_PUBLIC ) ) {
409
- $g_project_override = null;
410
- return $p_array[1] . string_get_bugnote_view_link( $t_bug_id, (int)$p_array[2], null, ' . ( $ p_detail_info ? 'true ' : 'false ' ) . ', ' . ( $ p_fqdn ? 'true ' : 'false ' ) . ' );
411
- } else {
412
- $g_project_override = null;
413
- return $p_array[0];
414
- }
415
- } else {
416
- return $p_array[0];
417
- }
418
- ' );
404
+ $ string_process_bugnote_link_callback [$ p_include_anchor ][$ p_detail_info ][$ p_fqdn ] =
405
+ create_function ( '$p_array ' ,
406
+ '
407
+ if ( bugnote_exists( (int)$p_array[2] ) ) {
408
+ $t_bug_id = bugnote_get_field( (int)$p_array[2], \'bug_id \' );
409
+ if ( bug_exists( $t_bug_id ) ) {
410
+ $g_project_override = bug_get_field( $t_bug_id, \'project_id \' );
411
+ if ( access_compare_level(
412
+ user_get_access_level( auth_get_current_user_id(),
413
+ bug_get_field( $t_bug_id, \'project_id \' ) ),
414
+ config_get( \'private_bugnote_threshold \' )
415
+ )
416
+ || bugnote_get_field( (int)$p_array[2], \'reporter_id \' ) == auth_get_current_user_id()
417
+ || bugnote_get_field( (int)$p_array[2], \'view_state \' ) == VS_PUBLIC
418
+ ) {
419
+ $g_project_override = null;
420
+ return $p_array[1] .
421
+ string_get_bugnote_view_link(
422
+ $t_bug_id,
423
+ (int)$p_array[2],
424
+ null,
425
+ ' . ( $ p_detail_info ? 'true ' : 'false ' ) . ', ' . ( $ p_fqdn ? 'true ' : 'false ' ) . '
426
+ );
427
+ }
428
+ $g_project_override = null;
429
+ }
430
+ }
431
+ return $p_array[0];
432
+ '
433
+ );
419
434
} else {
420
- $ string_process_bugnote_link_callback [$ p_include_anchor ][$ p_detail_info ][$ p_fqdn ] = create_function ( '$p_array ' , '
421
- # We might as well create the link here even if the bug
422
- # doesnt exist. In the case above we dont want to do
423
- # the summary lookup on a non-existant bug. But here, we
424
- # can create the link and by the time it is clicked on, the
425
- # bug may exist.
426
- $t_bug_id = bugnote_get_field( (int)$p_array[2], \'bug_id \' );
427
- if ( bug_exists( $t_bug_id ) ) {
428
- return $p_array[1] . string_get_bugnote_view_url_with_fqdn( $t_bug_id, (int)$p_array[2], null );
429
- } else {
430
- return $p_array[0];
431
- }
432
- ' );
435
+ $ string_process_bugnote_link_callback [$ p_include_anchor ][$ p_detail_info ][$ p_fqdn ] =
436
+ create_function (
437
+ '$p_array ' ,
438
+ '
439
+ # We might as well create the link here even if the bug
440
+ # doesnt exist. In the case above we dont want to do
441
+ # the summary lookup on a non-existant bug. But here, we
442
+ # can create the link and by the time it is clicked on, the
443
+ # bug may exist.
444
+ $t_bug_id = bugnote_get_field( (int)$p_array[2], \'bug_id \' );
445
+ if ( bug_exists( $t_bug_id ) ) {
446
+ return $p_array[1] . string_get_bugnote_view_url_with_fqdn( $t_bug_id, (int)$p_array[2], null );
447
+ } else {
448
+ return $p_array[0];
449
+ }
450
+ '
451
+ );
433
452
}
434
453
}
435
454
$ p_string = preg_replace_callback ( '/(^|[^\w]) ' . preg_quote ( $ t_tag , '/ ' ) . '(\d+)\b/ ' , $ string_process_bugnote_link_callback [$ p_include_anchor ][$ p_detail_info ][$ p_fqdn ], $ p_string );
0 commit comments