View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005271 | mantisbt | other | public | 2005-02-22 09:14 | 2025-01-06 07:59 |
Reporter | vboctor | Assigned To | community | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Target Version | 2.28.0 | Fixed in Version | 2.28.0 | ||
Summary | 0005271: Support NoFollow hyperlinks for external urls | ||||
Description | This is an addition to html that provides a way to stop search engines from following URLs. It discourages spammers from adding urls to their websites (automatically or manually), since they won't get any benefit from doing that. This is useful for installations where it is allowed for anonymous users to add comments or submit issues. See the following article for more details: More thought is needed before this issue is implemented. For example, should this be configurable? Should it apply for all links that start with http? ...etc. | ||||
Tags | No tags attached. | ||||
Is this inteded to be applied to links autogenerated in notes and such? |
|
I am thinking there is no harm in applying it to all links within Mantis. Independent of whether they are typed by anonymous user, developer, they are hyperlinked issue numbers, etc. I also don't think it should be configurable at this stage. |
|
This should only apply to external URLs. You don't want to put nofollow on your internal links, because then your site will not get indexed properly and/or your site will not be easily found by those searching about their problems. Because it would be a smaller subset of links being processed to only add nofollow to external links, it could easily be configured to the site maintainer's benefit:
By restricting the application of nofollow to links to untrusted sites by untrusted users, you can still help to stop spam without preventing Google et al from properly indexing links to valid reference sites and materials. It would be worse to blindly apply nofollow to every link on Mantis than it would be to not apply it at all. |
|
I agree with jreese's comments. The trusted threshold and sites should be configurable. |
|
Ok, let's see if we can sort this out without YACP (Yet Another Configuration Parameter) :) About the threshold, the point of the rel="nofollow" property is to avoid comment spam by removing the gain spammers get on thir page ranks. Spammers will (eventaully) try to use:
I think it is unlikely that a spammer will ever get an access level above 2, otherwise you have bigger problems to worry about... For this reason, I think we should add the nofollow tag to links cretated by users below $g_default_new_account_access_level I am not sure about "whitelisting" links because, as the googleblog says, the nofollow tag will affect only the target page rank in searches, not the indexing phase that will be performed as usual. If you really want to whitelist something, I'd propose to use the installation domain, but I believe this is marginal gain |
|
If you're dead set against adding configuration parameters, then I think a good baseline would be to do this:
I would still prefer to give the user the ability to whitelist other sites, but as you've said, it's not truly devastating to leave that out of the picture. |
|
Removed assignment. giallu will not contribute to this issue in near future. |
|
I can see the HTML-ization of links in user content is currently done in the function 'string_insert_hrefs' in /core/string_api.php Would a plugin be able to do this? |
|
The implementation in MantisBT is a plugin. |
|
I would like to take a shot at this. Will submit a PR soon. |
|
Thanks @c_schmitz, do not hesitate to ask if you need help. |
|
Thank you @c_schmitz for your contribution ! |
|
MantisBT: master 9f4ccf15 2024-11-10 11:51 Details Diff |
Document LINKS_NOFOLLOW_EXTERNAL constant Issue 0005271 |
Affected Issues 0005271 |
|
mod - config_defaults_inc.php | Diff File | ||
mod - docbook/Admin_Guide/en-US/config/html.xml | Diff File | ||
MantisBT: master cfe18445 2024-11-21 12:30 Committer: community Details Diff |
Support NoFollow hyperlinks for external urls Introduces new constant LINKS_NOFOLLOW_EXTERNAL to set `nofollow` link attributes on external links. Fixes 0005271, PR https://github.com/mantisbt/mantisbt/pull/2044 Signed-off-by: Damien Regad <dregad@mantisbt.org> |
Affected Issues 0005271 |
|
mod - config_defaults_inc.php | Diff File | ||
mod - core/constant_inc.php | Diff File | ||
mod - core/helper_api.php | Diff File | ||
mod - core/string_api.php | Diff File | ||
mod - plugins/MantisCoreFormatting/core/MantisMarkdown.php | Diff File | ||
MantisBT: master 59283d84 2024-11-21 12:34 Details Diff |
Set LINKS_NOFOLLOW_EXTERNAL as default Fixes 0005271 |
Affected Issues 0005271 |
|
mod - config_defaults_inc.php | Diff File | ||
mod - docbook/Admin_Guide/en-US/config/html.xml | Diff File | ||
MantisBT: master 40f71cf3 2024-12-29 08:49 Details Diff |
Fix nofollow attribute for relative URLs Extract duplicated code in MantisMarkdown::processUrl() and the callback in string_insert_hrefs() into a new helper_is_link_external() function. Add logic to treat relative URLs as internal. Fixes 0035210 Follow-up on issue 0005271, PR https://github.com/mantisbt/mantisbt/pull/2044 |
Affected Issues 0005271, 0035210 |
|
mod - core/helper_api.php | Diff File | ||
mod - core/string_api.php | Diff File | ||
mod - plugins/MantisCoreFormatting/core/MantisMarkdown.php | Diff File |