Code Duplication    Length = 16-16 lines in 2 locations

htdocs/xoops_lib/modules/protector/class/protector.php 2 locations

@@ 344-359 (lines=16) @@
341
     *
342
     * @return bool
343
     */
344
    public function write_file_bwlimit($expire)
345
    {
346
        $expire = min((int)$expire, time() + 300);
347
348
        $fp = @fopen($this->get_filepath4bwlimit(), 'w');
349
        if ($fp) {
350
            @flock($fp, LOCK_EX);
351
            fwrite($fp, $expire . "\n");
352
            @flock($fp, LOCK_UN);
353
            fclose($fp);
354
355
            return true;
356
        } else {
357
            return false;
358
        }
359
    }
360
361
    /**
362
     * @return mixed
@@ 385-400 (lines=16) @@
382
     *
383
     * @return bool
384
     */
385
    public function write_file_badips($bad_ips)
386
    {
387
        asort($bad_ips);
388
389
        $fp = @fopen($this->get_filepath4badips(), 'w');
390
        if ($fp) {
391
            @flock($fp, LOCK_EX);
392
            fwrite($fp, serialize($bad_ips) . "\n");
393
            @flock($fp, LOCK_UN);
394
            fclose($fp);
395
396
            return true;
397
        } else {
398
            return false;
399
        }
400
    }
401
402
    /**
403
     * @param int  $jailed_time