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