diff --git a/owark.php b/owark.php index 365733f..80a5c54 100644 --- a/owark.php +++ b/owark.php @@ -1,8 +1,8 @@ 30) ) ) { wp_schedule_event(time(), 'hourly', 'owark_schedule_event', array('occurrences' => 30)); } @@ -133,7 +133,7 @@ if (!class_exists("Owark")) { if (!is_dir(dirname(__FILE__) . '/archives')) { @mkdir(dirname(__FILE__) . '/archives'); if (!is_dir(dirname(__FILE__) . '/archives')) { - $this->notices = $this->notices . "

The Open Web Archive has not been able to create the folder /archives in its installation directory. Please create it by hand and make it writable for the web server.

"; + $this->notices = $this->notices . "

The Open Web Archive has not been able to create the folder /archives in its installation directory. Please create it by hand and make it writable for the web server.

"; } } @@ -149,17 +149,18 @@ if (!class_exists("Owark")) { // Check that wget is installed $output = array(); - exec('/usr/bin/wget -V', &$output); + exec('/usr/bin/wget -V', $output); if ( empty($output) ) { - $this->notices = $this->notices . "

The Open Web Archives is not able to run wget and retrieve the pages to archive. Please check that wget is installed and on the default path.

"; + $this->notices = $this->notices . + "

The Open Web Archives is not able to run GNU wget and retrieve the pages to archive. Please check that wget is installed and on the default path.

"; } // We need as least version 1.11 or higher $helper = preg_match('/GNU Wget ([0-9\.]+) /', $output[0], $wget_version); - if ( $wget_version[1] < '1.11' ) { - $this->notices = $this->notices . "

The Open Web Archives needs wget version 1.11 or higher.
Version read: {$wget_version[0]}

"; + if ( $wget_version[0] < '1.11' ) { + $this->notices = $this->notices . "

The Open Web Archives needs GNU wget version 1.11 or higher.
Version read: {$wget_version[0]}

"; } if ($this->notices != '') { @@ -439,7 +440,7 @@ if (!class_exists("Owark")) { $loc = '/wp-content/plugins/owark' . substr($link->arc_location, $pos); $arc_loc = home_url() . $loc; - // The file name is either index.html or guessed from the URL + // The file name is either index.html or guessed from the URL if ($home_url[strlen($home_url)] == '/') { $file_location = '.'. $loc .'/index.html'; } else { @@ -480,7 +481,7 @@ if (!class_exists("Owark")) { $matches = NULL; // if (preg_match('/]*charset\s*=\s*([^"\'>]+)\s*["\']/si', - $content, &$matches) > 0) { + $content, $matches) > 0) { $encoding = $matches[1]; } else { $encoding = mb_detect_encoding($content); @@ -543,12 +544,12 @@ if (!class_exists("Owark")) { $date = date('c'); $relpath = '/archives/'. str_replace('%2F', '/', urlencode(preg_replace('/https?:\/\//', '', $url->final_url))) . '/' . $date; $path = dirname(__FILE__).$relpath; - //mkdir($path, $recursive=true); + //mkdir($path, $recursive=true); $output = array(); $status = 0; exec("wget -t3 -E -H -k -K -p -nd -nv --timeout=60 --user-agent=\"Mozilla/5.0 (compatible; owark/0.1; http://owark.org/)\" -P $path {$url->final_url}", - &$output, &$status); + $output, $status); $q = $wpdb->insert("{$wpdb->prefix}owark", array( 'url' => $url->final_url, @@ -557,7 +558,7 @@ if (!class_exists("Owark")) { 'arc_location' => $relpath)); if ($occurrences > 0) { - wp_schedule_single_event(time() + 90, 'owark_schedule_event', array('occurrences' => $occurrences - 1)); + wp_schedule_single_event(time() + 90, 'owark_schedule_event', array('occurrences' => $occurrences - 1)); } }