diff options
author | Hakan Sandell <sandell.hakan@gmail.com> | 2012-09-08 02:18:41 -0700 |
---|---|---|
committer | Hakan Sandell <sandell.hakan@gmail.com> | 2012-09-08 02:18:41 -0700 |
commit | ab2768f6fc3c0340ad6d238f831f0bf4ead5ad5b (patch) | |
tree | 879eddfcfcfe59f43b5539eb9e803f37297bafa8 /lib | |
parent | 10295f78866be6074f00369aa219c67d867ad610 (diff) | |
parent | e10c99f4364d7caf985936fb23fe5630f699c8bc (diff) | |
download | rpg-ab2768f6fc3c0340ad6d238f831f0bf4ead5ad5b.tar.gz rpg-ab2768f6fc3c0340ad6d238f831f0bf4ead5ad5b.tar.bz2 |
Merge pull request #127 from mprins/FS#2463
update the url to the latest one used in the manager (FS#2463)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/plugins/plugin/classes/ap_manage.class.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/plugins/plugin/classes/ap_manage.class.php b/lib/plugins/plugin/classes/ap_manage.class.php index 12480e922..28579cbe9 100644 --- a/lib/plugins/plugin/classes/ap_manage.class.php +++ b/lib/plugins/plugin/classes/ap_manage.class.php @@ -141,9 +141,18 @@ class ap_manage { break; case 'update' : + $url = $data[0]; $date = date('r'); - if (!$fp = @fopen($file, 'a')) return; - fwrite($fp, "updated=$date\n"); + if (!$fp = @fopen($file, 'r+')) return; + $buffer = ""; + while (($line = fgets($fp)) !== false) { + $urlFound = strpos($line,"url"); + if($urlFound !== false) $line="url=$url\n"; + $buffer .= $line; + } + $buffer .= "updated=$date\n"; + fseek($fp, 0); + fwrite($fp, $buffer); fclose($fp); break; } |