diff --git a/README b/README
index b3f918a..a4b9a1f 100644
--- a/README
+++ b/README
@@ -2,7 +2,10 @@
 Public Download Count (pubdlcnt) 2.x
     - file download count module for public file sytem
 
-(C)Copyright 2009-2011 Hideki Ito, Pixture Inc. All rights reserved.
+(C) Copyright 2009 Hideki Ito <hide@pixture.com> Pixture Inc.
+
+Distributed under the GNU General Public License, version 2.0
+  https://opensource.org/licenses/GPL-2.0
 
 
 Introduction
diff --git a/includes/pubdlcnt.views.inc b/includes/pubdlcnt.views.inc
index 36f9a75..71a1471 100644
--- a/includes/pubdlcnt.views.inc
+++ b/includes/pubdlcnt.views.inc
@@ -4,6 +4,10 @@
 /**
  * @file
  * Provides views data for pubdlcnt.module
+ *
+ * Copyright 2009 Hideki Ito <hide@pixture.com> Pixture Inc.
+ * Distributed under the GNU General Public License, version 2.0
+ *   https://opensource.org/licenses/GPL-2.0
  */
 
 /** 
diff --git a/pubdlcnt.info b/pubdlcnt.info
old mode 100755
new mode 100644
diff --git a/pubdlcnt.install b/pubdlcnt.install
old mode 100755
new mode 100644
index dbee2aa..9b4d87f
--- a/pubdlcnt.install
+++ b/pubdlcnt.install
@@ -6,8 +6,9 @@
  *
  * module install/uninstall script
  *
- * @ingroup pubdlcnt
- *
+ * Copyright 2009 Hideki Ito <hide@pixture.com> Pixture Inc.
+ * Distributed under the GNU General Public License, version 2.0
+ *   https://opensource.org/licenses/GPL-2.0
  */
 
 /**
diff --git a/pubdlcnt.module b/pubdlcnt.module
index 8faaa0f..b501415 100644
--- a/pubdlcnt.module
+++ b/pubdlcnt.module
@@ -1,14 +1,11 @@
 <?php
-// $id:
-
 /**
- * @file
- * 
  * public file download count module (for Drupal's public file system)
  *
- * @ingroup pubdlcnt
- *
- * Copyright 2009-2011 Hideki Ito <hide@pixture.com> Pixture Inc. All rights reserved.
+ * Copyright 2009 Hideki Ito <hide@pixture.com> Pixture Inc.
+ * Copyright 2016 Corey Halpin <chalpin@scout.wisc.edu>, Internet Scout Research Group
+ * Distributed under the GNU General Public License, version 2.0
+ *   https://opensource.org/licenses/GPL-2.0
  */
 
 define("MODE_TOTAL",   0);
@@ -47,7 +44,22 @@ function _filter_pubdlcnt($text, $nid) {
   $text = str_replace(array("\r\n", "\r"), "\n", $text);
 
   // 2. convert anchor tag
-  $text = preg_replace('/(<a.*?>)(.*?)(<\/a>)/ise', "_pubdlcnt_replace_anchor_url('$0', '$1', '$2', '$3', $nid)", $text);
+  $new_text = preg_replace_callback(
+    '/(<a .*?>)(.*?)(<\/a>)/is',
+    function($matches) use ($nid) {
+      _pubdlcnt_replace_anchor_url(
+        $matches[0],
+        $matches[1],
+        $matches[2],
+        $matches[3],
+        $nid);
+    }, $text);
+
+  // use modified text if there were no errors
+  if ($new_text !== NULL)
+  {
+    $text = $new_text;
+  }
 
   return $text;
 }
@@ -465,11 +477,17 @@ function pubdlcnt_counter_form($form, &$form_state, $p1=NULL, $p2=NULL, $p3=NULL
       // obtain node title in the current language if there's transated node
       $nid = _pubdlcnt_get_translated_node_id($rec->nid);
       $node = node_load($nid);
-      $row[] = array('data' => '<a href="' . base_path() . _pubdlcnt_language_prefix() . 'node/' . $nid . '">' . $node->title . '</a>', 
+
+      // escape content to protect against XSS
+      $safe_title = htmlspecialchars($node->title);
+      $safe_name = htmlspecialchars($rec->name);
+      $safe_user = htmlspecialchars($rec->username);
+
+      $row[] = array('data' => '<a href="' . base_path() . _pubdlcnt_language_prefix() . 'node/' . $nid . '">' . $safe_title . '</a>',
                                'align' => 'left', 'style' => 'padding-right: 20px');
-      $row[] = array('data' => '<a href="' . base_path() . _pubdlcnt_language_prefix() . 'node/' . $nid . '">' . $rec->name, 
+      $row[] = array('data' => '<a href="' . base_path() . _pubdlcnt_language_prefix() . 'node/' . $nid . '">' . $safe_name,
                                'align' => 'left', 'style' => 'padding-right: 20px');
-      $row[] = array('data' => '<a href="' . base_path() . 'user/' . $rec->uid . '">' . $rec->username . '</a>', 'align' => 'left'); 
+      $row[] = array('data' => '<a href="' . base_path() . 'user/' . $rec->uid . '">' . $safe_user . '</a>', 'align' => 'left');
       $row[] = array('data' => $dateonly,   'align' => 'left', 'style' => 'padding-right: 20px');
       if ($save_history) {
         $row[] = array('data' => '<a href="' 
diff --git a/pubdlcnt.php b/pubdlcnt.php
old mode 100755
new mode 100644
index a577507..13c0cdc
--- a/pubdlcnt.php
+++ b/pubdlcnt.php
@@ -19,7 +19,8 @@
  *       to obtain some module settings.
  *
  * Copyright 2009 Hideki Ito <hide@pixture.com> Pixture Inc.
- * Distributed under the GPL Licence.
+ * Distributed under the GNU General Public License, version 2.0
+ *   https://opensource.org/licenses/GPL-2.0
  */
 
 /**
diff --git a/sample-template.php b/sample-template.php
index 2f55152..1de063d 100644
--- a/sample-template.php
+++ b/sample-template.php
@@ -1,4 +1,10 @@
 <?php
+/*
+ * Copyright 2009 Hideki Ito <hide@pixture.com> Pixture Inc.
+ * Distributed under the GNU General Public License, version 2.0
+ *   https://opensource.org/licenses/GPL-2.0
+ */
+
 /**
  * customizing counter display of public download count module
  *
