1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Duplicate Checks for partial class names don't check for namespaces

Discussion in 'Resolved Bug Reports' started by Jon W, Jul 23, 2015.

  1. Jon W

    Jon W Well-Known Member

    There are three methods in XenForo which allow for partial class names to be used.

    These are:

    All three methods use the following line of code to check whether a partial or full class name has been used:
    if (strpos($class, '_') === false)
    This follows the assumption that all full class names will contain an underscore. However, this assumption is not always correct if namespaces are used.

    I suggest that it be replaced with the following code:
    if (strpos($class, '_') === false && strpos($class, '\\') === false)
    or something similar.

    Thanks. :)
  2. Liam W

    Liam W Well-Known Member

    I'm almost certain this was reported before and marked as won't fix.

    Can't remember when though. I'll see if I can find it...

    Jon W likes this.
  3. Liam W

    Liam W Well-Known Member

    Jon W likes this.
  4. Chris D

    Chris D XenForo Developer Staff Member

    The same thoughts still apply to these cases. We're not planning on adding further namespace support in XF 1.x.

Share This Page