Dear Madams and Sirs,

because the DOI foundation recommends a new, secure resolver [1], I
wanted to suggest the attached patch. It

a) updates a static DOI link in the docu,
b) the code chunks that generate new ones, and
c) a reg-ex that detects DOI links.

Hopefully, my first venture into SVN & patch files was done correctly.
My apologies, if there is anything amiss. In that case, I'll be happy to
update the patch according to your advice.

Thank you, and kind regards,
Katrin Leinweber


[1]: https://www.doi.org/doi_handbook/3_Resolution.html#3.8
[2]: https://github.com/parklab/nozzle/pull/27


PS: I left jss.cls untouched, because I emailed an equivalent patch to
the JSS team already, and presume that their update will trickle down in
due time.

PPS: Through RSiteSearch("DOI resolver") I also found instances of
dx.doi.org in Nozzle.R1, to which I had submitted a PR already [2].

Index: src/library/stats/man/HoltWinters.Rd
===================================================================
--- src/library/stats/man/HoltWinters.Rd        (revision 74460)
+++ src/library/stats/man/HoltWinters.Rd        (working copy)
@@ -109,7 +109,7 @@
   C. C. Holt (1957)
   Forecasting seasonals and trends by exponentially weighted moving averages,
   \emph{ONR Research Memorandum, Carnegie Institute of Technology} \bold{52}.
-  (reprint at \url{http://dx.doi.org/10.1016/j.ijforecast.2003.09.015}).
+  (reprint at \url{https://doi.org/10.1016/j.ijforecast.2003.09.015}).
 
   P. R. Winters (1960).
   Forecasting sales by exponentially weighted moving averages.
Index: src/library/tools/R/toHTML.R
===================================================================
--- src/library/tools/R/toHTML.R        (revision 74460)
+++ src/library/tools/R/toHTML.R        (working copy)
@@ -310,12 +310,12 @@
                                                 urlify,
                                                 2L)
             s <- 
.gsub_with_transformed_matches("&lt;(DOI|doi):[[:space:]]*([^<[:space:]]+[[:alnum:]])&gt;",
-                                                "&lt;<a 
href=\"http://dx.doi.org/%s\";>doi:\\2</a>&gt;",
+                                                "&lt;<a 
href=\"https://doi.org/%s\";>doi:\\2</a>&gt;",
                                                 s,
                                                 urlify,
                                                 2L)
             s <- 
.gsub_with_transformed_matches("[^>\"](DOI|doi):[[:space:]]*([^<[:space:]]+[[:alnum:]])",
-                                                "&lt;<a 
href=\"http://dx.doi.org/%s\";>doi:\\2</a>&gt;",
+                                                "&lt;<a 
href=\"https://doi.org/%s\";>doi:\\2</a>&gt;",
                                                 s,
                                                 urlify,
                                                 2L)
Index: src/library/tools/R/utils.R
===================================================================
--- src/library/tools/R/utils.R (revision 74460)
+++ src/library/tools/R/utils.R (working copy)
@@ -600,7 +600,7 @@
 .canonicalize_doi <-
 function(x)
 {
-    x <- sub("^((doi|DOI):)?[[:space:]]*http://(dx[.])?doi[.]org/", "",
+    x <- sub("^((doi|DOI):)?[[:space:]]*https:?//(dx[.])?doi[.]org/", "",
              x)
     sub("^(doi|DOI):", "", x)
 }
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to