Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: e_parse.php #5418

Open
rica-carv opened this issue Jan 30, 2025 · 0 comments
Open

[Bug]: e_parse.php #5418

rica-carv opened this issue Jan 30, 2025 · 0 comments
Labels
type: bug A problem that should not be happening

Comments

@rica-carv
Copy link
Contributor

What e107 version are you using?

Latest Github version (just updated)

Bug description

There's a heavy bug with the e_parse.php file.

If it's bad constructed, it can make e107 sitewide constants not defined by default.

How to reproduce

Use a bad constructed e_parse.php file, for instance:

<?php
/*
 * e107 website system
 *
 * Copyright (C) 2008-2010 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_plugins/linkwords/e_tohtml.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */



if (!defined('e107_INIT')) { exit; }


class eforum_parse
{


	/* constructor */
	function __construct(){
				include_once(e_PLUGIN . "forum/forum_class.php");
				$this->forumObj = new e107forum();
		
			$this->tp = e107::getParser();

		$arrbread = e107::breadcrumb();
				if ((strpos( e_PAGE, "forum")!==false) && !defined('EFBCCONSTR_EXEC') && $arrbread){
		  define('EFBCCONSTR_EXEC', true);
		// Código para injectar uma drop down list nos breadcrumbs...
		  $replarr = array_pop($arrbread);
		  if (strpos( e_PAGE, "viewtopic")!==false) {
			$endarr = $replarr;
			$replarr = array_pop($arrbread);
		  }

		  $options = '<a class="dropdown-toggle" role="button" data-toggle="dropdown" data-bs-toggle="dropdown" id="navbarDropdownMenuLink-7" data-target="#" aria-haspopup="true" aria-expanded="false" href="#" title="">'.
		$replarr['text'].'</a><ul class="dropdown-menu">';
		
			$sql = e107::getDb('forumnav');
			$forumList = implode(',', $this->forumObj->getForumPermList('view'));
			$qry = "
			SELECT f.forum_id, f.forum_name, f.forum_sef, pf.forum_name AS parent_name
			FROM `#forum` AS f LEFT JOIN `#forum` AS pf
			ON f.forum_parent = pf.forum_id
			WHERE f.forum_id IN ({$forumList}) AND f.forum_parent != 0
			ORDER BY pf.forum_id, f.forum_name";
			
			if ($sql->gen($qry))
			{
			  while($val = $sql->fetch())
			  {
				$options .= '<li class="dropdown-item"><a href ="' . e107::url('forum', 'forum', $val) . '"><span class="forum_parent">' . $val['parent_name'] . "</span>" . $val['forum_name'] . '</a></li>';
			  }
			  $options .= '</ul>';
				////      $arrbread = (e107::breadcrumb());
			}
		  $replarr['text'] = $options;
		  $replarr['url'] = null;
		$arrbread[] = $replarr;
		if (strpos( e_PAGE, "viewtopic")!==false) {
		  $arrbread[] = $endarr;
		}
		  e107::breadcrumb($arrbread);
		  }
	
		  }
}

In this case, it will prevent the THEME & THEME_ABS e07 constants being properly declared....

Expected behavior

Prevent bad coding in e_parse.php?

What browser(s) are you seeing the problem on?

Firefox

PHP Version

PHP 7.4.33

@rica-carv rica-carv added the type: bug A problem that should not be happening label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A problem that should not be happening
Projects
None yet
Development

No branches or pull requests

1 participant