(a) Offense defined.--A person is guilty of a summary offense if he pastes, paints, brands or stamps or in any manner whatsoever places upon or attaches to any building, fence, bridge, gate, outbuilding or other object, upon the grounds of any charitable, educational or penal institution of the Commonwealth, or upon any property belonging to the Commonwealth government, any political subdivision, or municipal or local authority, any written, printed, painted or other advertisement, bill, notice, sign or poster, or pastes, paints, brands, stamps or in any manner whatsoever places upon, or attaches to any building, fence, bridge, gate, outbuilding or property of another, whether within or without the limits of a highway, any written, printed, painted or other advertisement, bill, notice, sign, card or poster, without first having obtained the written consent of the owner, or tenant lawfully in possession or occupancy thereof.
(b) Exception.--Subsection (a) of this section shall not prevent the posting or placing of any notice required by law or order of court, nor to prevent the posting or placing of any notice particularly concerning or pertaining to premises upon which the same is so posted or placed.