[ Index ]

PHP Cross Reference of phpBB-3.1.10-deutsch

title

Body

[close]

/phpbb/ -> viewonline_helper.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb;
  15  
  16  /**
  17  * Class to handle viewonline related tasks
  18  */
  19  class viewonline_helper
  20  {
  21      /** @var \phpbb\filesystem */
  22      protected $filesystem;
  23  
  24      /**
  25      * @param \phpbb\filesystem $filesystem
  26      */
  27  	public function __construct(\phpbb\filesystem $filesystem)
  28      {
  29          $this->filesystem = $filesystem;
  30      }
  31  
  32      /**
  33      * Get user page
  34      *
  35      * @param string $session_page User's session page
  36      * @return array Match array filled by preg_match()
  37      */
  38  	public function get_user_page($session_page)
  39      {
  40          $session_page = $this->filesystem->clean_path($session_page);
  41          if (strpos($session_page, './') === 0)
  42          {
  43              $session_page = substr($session_page, 2);
  44          }
  45  
  46          preg_match('#^((\.\./)*([a-z0-9/_-]+))#i', $session_page, $on_page);
  47          if (empty($on_page))
  48          {
  49              $on_page[1] = '';
  50          }
  51  
  52          return $on_page;
  53      }
  54  }


Generated: Sun Feb 19 19:52:41 2017 Cross-referenced by PHPXref 0.7.1