Skip to content

Conversation

CyberShadow
Copy link
Member

Remove a hard-coded BMO reference.

@dylanwh dylanwh changed the title search-google.html.tmpl: Calculate sitesearch from urlbase Bug 1446236 - search-google.html.tmpl: Calculate sitesearch from urlbase Mar 16, 2018

<form method="get" action="https://www.google.com/search">
<input type="hidden" name="sitesearch" value="bugzilla.mozilla.org">
<input type="hidden" name="sitesearch" value="[% urlbase.match('^([^:]*://)?(.*?)/?$').1 %]">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the stuff in #25 you can just write [% urlbase.host FILTER html %]

Copy link
Member Author

@CyberShadow CyberShadow Mar 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the case when Bugzilla is not installed at the domain root?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Perhaps... urlbase.host _ urlbase.path?
I'm not sure if sitesearch takes path though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fairly sure it does, we've been using it for https://dlang.org/phobos/ for a while. Trailing slash is optional, not sure if it should be removed (for aesthetic reasons & to preserve behaviour identical to before the change)?

@dylanwh dylanwh merged commit 0e38837 into bugzilla:unstable Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants