def isValid(cmd):
    if len(cmd) == 0:
        return False

    cmd = tidy(cmd)

    if 'PlayMedia' in cmd:
        return utils.verifyPlayMedia(cmd)

    if 'plugin' in cmd:
        if not utils.verifyPlugin(cmd):
            return False

    if 'RunScript' in cmd:
        cmd = re.sub('/&content_type=(.+?)"\)', '")', cmd)
        if not utils.verifyScript(cmd):
            return False

    return True
Beispiel #2
0
def isValid(cmd):
    if len(cmd) == 0:
        return False

    cmd = tidy(cmd)

    if 'PlayMedia' in cmd:
        return utils.verifyPlayMedia(cmd)
        

    if 'plugin' in cmd:        
        if not utils.verifyPlugin(cmd):
            return False

    if 'RunScript' in cmd:
        cmd = re.sub('/&content_type=(.+?)"\)', '")', cmd)
        if not utils.verifyScript(cmd):
            return False
        
    return True
Beispiel #3
0
def isValid(cmd):
    if len(cmd) == 0:
        return False

    cmd = tidy(cmd)

    # if 'PlayMedia' in cmd:
    if cmd.startswith("PlayMedia"):
        return utils.verifyPlayMedia(cmd)

    # if 'RunScript' in cmd:
    if cmd.startswith("RunScript"):
        cmd = re.sub('/&content_type=(.+?)"\)', '")', cmd)
        if not utils.verifyScript(cmd):
            return False

    if "plugin" in cmd:
        if not utils.verifyPlugin(cmd):
            return False

    return True