Edgewall Software

Opened 8 years ago

Last modified 8 years ago

#12451 closed defect

Error reports are not directed to trac-hacks.org if home_page or url attribute starts with https — at Initial Version

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 0.12.8
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The issue is due to use of startswith to compare against the string http://trac-hacks.org: tags/trac-0.12.7/trac/web/main.py@:586,612#L578.

Proposed change:

  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index ee7b0bb..9808ecf 100644
    a b from pprint import pformat, pprint  
    3131import re
    3232import sys
    3333import traceback
     34from urlparse import urlparse
    3435
    3536from genshi.builder import tag
    3637from genshi.output import DocType
    def send_internal_error(env, req, exc_info):  
    670671            faulty_plugins.sort(key=lambda p: p['frame_idx'])
    671672            if faulty_plugins:
    672673                info = faulty_plugins[0]['info']
     674                home_page = info.get('home_page', '')
    673675                if 'trac' in info:
    674676                    tracker = info['trac']
    675                 elif info.get('home_page', '').startswith(th):
     677                elif urlparse(home_page).netloc == urlparse(th).netloc:
    676678                    tracker = th
    677679                    plugin_name = info.get('home_page', '').rstrip('/') \
    678680                                                           .split('/')[-1]

Patch was created against the trunk. I will need to test it for 1.0-stable and 0.12-stable.

Change History (0)

Note: See TracTickets for help on using tickets.