We propose a resource-efficient error-rejecting entangled-state analyzer for polarization-encoded multiphoton systems. Our analyzer is based on two single-photon quantum-nondemolition detectors, where each of them is implemented with a four-level emitter (e.g., a quantum dot) coupled to a one-dimensional system (such as a micropillar cavity or a photonic nanocrystal waveguide). The analyzer works in a passive way and can completely distinguish $2^n$ Greenberger-Horne-Zeilinger~(GHZ) states of $n$ photons without using any active operation or fast switching. The efficiency and fidelity of the GHZ-state analysis can, in principle, be close to unity, when an ideal single-photon scattering condition is fulfilled. For a nonideal scattering, which typically reduces the fidelity of a GHZ-state analysis, we introduce a passively error-rejecting circuit to enable a near-perfect fidelity at the expense of a slight decrease of its efficiency. Furthermore, the protocol can be directly used to perform a two-photon Bell-state analysis. This passive, resource-efficient, and error-rejecting protocol can, therefore, be useful for practical quantum networks.