Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 284-298 (lines=15) @@
281
    /**
282
     * @param integer $expire
283
     */
284
    function write_file_bwlimit($expire)
285
    {
286
        $expire = min((int)($expire), time() + 300);
287
288
        $fp = @fopen($this->get_filepath4bwlimit(), 'w');
289
        if ($fp) {
290
            @flock($fp, LOCK_EX);
291
            fwrite($fp, $expire . "\n");
292
            @flock($fp, LOCK_UN);
293
            fclose($fp);
294
            return true;
295
        } else {
296
            return false;
297
        }
298
    }
299
300
    function get_bwlimit()
301
    {
@@ 313-327 (lines=15) @@
310
        return \XoopsBaseConfig::get('trust-path') . '/modules/protector/configs/bwlimit' . substr(md5(\XoopsBaseConfig::get('root-path') . \XoopsBaseConfig::get('db-user') . \XoopsBaseConfig::get('db-prefix')), 0, 6);
311
    }
312
313
    function write_file_badips($bad_ips)
314
    {
315
        asort($bad_ips);
316
317
        $fp = @fopen($this->get_filepath4badips(), 'w');
318
        if ($fp) {
319
            @flock($fp, LOCK_EX);
320
            fwrite($fp, serialize($bad_ips) . "\n");
321
            @flock($fp, LOCK_UN);
322
            fclose($fp);
323
            return true;
324
        } else {
325
            return false;
326
        }
327
    }
328
329
    function register_bad_ips($jailed_time = 0, $ip = null)
330
    {