HARRISBURG - Guns, gangs, prisons, and sexting.

Those were among the topics addressed in a river of bills that flowed through both chambers Wednesday as legislators made a frenzied dash to complete their work before the end of their two-year session this week.

In what has become the Capitol version of finals week, legislators in the House and Senate kicked bills to one another late into the evening. Any bills that do not move to the governor's desk this week will die and have to be reintroduced in 2013, when lawmakers begin a new two-year session.

One bill poised to reach Gov. Corbett's desk would create criminal penalties for minors who engage in sexting - transmitting nude or otherwise sexually explicit images of themselves or other youths.

Another would toughen penalties for illegal gun sales. That measure gained momentum after a recent arrest in the case of Plymouth Township Officer Bradley Fox, shot to death last month while pursuing a hit-and-run driver. Authorities traced his assailant's gun to a straw purchaser.

"This is a historic day," said Sen. Larry Farnese (D., Phila.), who drafted the original proposal in 2011. "This gets guns out of the hands of people who cannot own them."

A spokeswoman for Corbett said the governor would "likely sign" the bill.

Gang violence

The sexting measure would punish those under 17 with a summary offense or misdemeanor depending on the case. Minors could get their record expunged after completing a diversionary program. Corbett spokesman Kevin Harley said the governor would sign it.

Another measure headed to the governor is part of a prison-reform package that would send money to counties for improved policing and probation, as well as housing offenders in county prisons.

A separate approved bill would make it a crime to recruit gang members, strengthening penalties for crimes by street gangs.

"Gang violence is impacting communities all across Pennsylvania, urban, suburban, and rural," said Senate Majority Leader Dominic Pileggi (R., Delaware), one of the sponsors.

One measure that seemed certain to reach Corbett collapsed Wednesday night: a bill to tighten ethics and reporting provisions for charter schools and overhaul special-education funding to favor districts with the most severely disabled special-needs students. The governor had said it was high on his priority list.

Despite the legislative cram session Wednesday, this session may end up being notable as much for what didn't become law as for what did.

Some of the biggest-ticket items of the last two years will remain untouched until next year, including reducing the cost of public employee pensions, solving Pennsylvania's transportation funding woes, and trying to privatize wine and liquor sales. Legislators were loath to take up those issues in an election year.

Shortened session

Complicating matters was that the fall session was only three weeks long because senators and House members wanted to break in mid-October to return to their districts, where many will campaign for reelection.

Still, legislative leaders have touted this session as successful, saying it produced continued business tax cuts, tort reform, an expansion of the so-called castle doctrine, and a new law for a fee on natural gas extraction from the Marcellus Shale.

They also hailed Wednesday's passage of the straw purchasing bill, which had some fierce opponents, among them the National Rifle Association.

The bill mandates a five-year minimum sentence for anyone convicted of purchasing multiple guns for a felon.

A straw purchase occurs when someone without a criminal record purchases a gun for someone who was convicted of a felony and thus cannot purchase a gun. Because straw purchasers have clean records, they typically have received lenient sentences no matter the number of illegal guns they purchased, the bill's backers said.

Contact Angela Couloumbis

at 717-787-5934 or acouloumbis@phillynews.com, or follow on Twitter @AngelasInk.