Changerd PathLimitProcessor to use substr_count instead of exploding strings and counting array elements