Ticket #1376: patch_to_make_work2.txt
|
File patch_to_make_work2.txt, 0.5 kB
(added by sci2tech, 5 months ago)
|
Symplifyed patch. Please ingnore the rest
|
| Line | |
|---|
| 1 |
--- class.database.php 2008-07-05 09:31:49.000000000 +0300 |
|---|
| 2 |
+++ /var/www/ispcp/gui/include/class.database.php 2008-07-05 10:02:20.000000000 +0300 |
|---|
| 3 |
@@ -55,6 +55,10 @@ |
|---|
| 4 |
} |
|---|
| 5 |
|
|---|
| 6 |
public function Prepare($sql) { |
|---|
| 7 |
+ if(version_compare(PHP_VERSION,'5.2.5','<')){ |
|---|
| 8 |
+ if(preg_match("/((ALTER )|(CREATE )|(DROP )|(GRANT )|(REVOKE )|(FLUSH ))/i", $sql, $matches) > 0) $this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, true); |
|---|
| 9 |
+ else $this->_db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false); |
|---|
| 10 |
+ } |
|---|
| 11 |
return $this->_db->prepare($sql); |
|---|
| 12 |
} |
|---|
| 13 |
|
|---|
|
Download in other formats:
#########################################################################
# Site footer - Contents are automatically inserted after main Trac HTML
?>