Code Duplication    Length = 9-9 lines in 2 locations

sources/database/Db-abstract.class.php 1 location

@@ 349-357 (lines=9) @@
346
	 * @return string
347
	 * @throws Elk_Exception
348
	 */
349
	protected function _replaceIdentifier($replacement)
350
	{
351
		if (preg_match('~[a-z_][0-9,a-z,A-Z$_]{0,60}~', $replacement) !== 1)
352
		{
353
			$this->error_backtrace('Wrong value type sent to the database. Invalid identifier used. (' . $replacement . ')', '', E_USER_ERROR, __FILE__, __LINE__);
354
		}
355
356
		return '`' . $replacement . '`';
357
	}
358
359
	/**
360
	 * This function tries to work out additional error information from a back trace.

sources/database/Db-postgresql.class.php 1 location

@@ 973-981 (lines=9) @@
970
	 * @return string
971
	 * @throws Elk_Exception
972
	 */
973
	protected function _replaceIdentifier($replacement)
974
	{
975
		if (preg_match('~[a-z_][0-9,a-z,A-Z$_]{0,60}~', $replacement) !== 1)
976
		{
977
			$this->error_backtrace('Wrong value type sent to the database. Invalid identifier used. (' . $replacement . ')', '', E_USER_ERROR, __FILE__, __LINE__);
978
		}
979
980
		return '"' . $replacement . '"';
981
	}
982
983
	/**
984
	 * Escape string for the database input