Edit File by line
/home/barbar84/www/wp-inclu.../sodium_c...
File: autoload-php7.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
This file should only ever be loaded on PHP 7+
[2] Fix | Delete
*/
[3] Fix | Delete
if (PHP_VERSION_ID < 70000) {
[4] Fix | Delete
return;
[5] Fix | Delete
}
[6] Fix | Delete
[7] Fix | Delete
spl_autoload_register(function ($class) {
[8] Fix | Delete
$namespace = 'ParagonIE_Sodium_';
[9] Fix | Delete
// Does the class use the namespace prefix?
[10] Fix | Delete
$len = strlen($namespace);
[11] Fix | Delete
if (strncmp($namespace, $class, $len) !== 0) {
[12] Fix | Delete
// no, move to the next registered autoloader
[13] Fix | Delete
return false;
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
// Get the relative class name
[17] Fix | Delete
$relative_class = substr($class, $len);
[18] Fix | Delete
[19] Fix | Delete
// Replace the namespace prefix with the base directory, replace namespace
[20] Fix | Delete
// separators with directory separators in the relative class name, append
[21] Fix | Delete
// with .php
[22] Fix | Delete
$file = dirname(__FILE__) . '/src/' . str_replace('_', '/', $relative_class) . '.php';
[23] Fix | Delete
// if the file exists, require it
[24] Fix | Delete
if (file_exists($file)) {
[25] Fix | Delete
require_once $file;
[26] Fix | Delete
return true;
[27] Fix | Delete
}
[28] Fix | Delete
return false;
[29] Fix | Delete
});
[30] Fix | Delete
[31] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function