diff --git a/block_course_overview_campus.php b/block_course_overview_campus.php
index f34636987cc3d7dc721c97a7c0482a1987d64108..804a8dddeb103abab3895ded15ef322540860670 100644
--- a/block_course_overview_campus.php
+++ b/block_course_overview_campus.php
@@ -102,7 +102,7 @@ class block_course_overview_campus extends block_base {
         }
 
         // Include local library.
-        require_once(dirname(__FILE__) . '/locallib.php');
+        require_once(__DIR__ . '/locallib.php');
 
         // Get plugin config.
         $coc_config = get_config('block_course_overview_campus');
@@ -114,7 +114,7 @@ class block_course_overview_campus extends block_base {
         /********************************************************************************/
 
         // Include local library.
-        require_once(dirname(__FILE__) . '/locallib.php');
+        require_once(__DIR__ . '/locallib.php');
 
 
         // Check if the configured term dates make sense, if not disable term filter.
diff --git a/settings.php b/settings.php
index a207b016872cd683bd92b7f3f2b228977f644967..32c9920482cfbcd9a293b07527bfc36bc28aca73 100644
--- a/settings.php
+++ b/settings.php
@@ -90,7 +90,7 @@ if ($hassiteconfig) {
     // Create full settings page structure.
     else if ($ADMIN->fulltree) {
         // Include local library.
-        require_once(dirname(__FILE__) . '/locallib.php');
+        require_once(__DIR__ . '/locallib.php');
 
 
         // Settings page: General.