Changeset 6443 for branches/2.3/wp-includes/wp-db.php
- Timestamp:
- 12/21/2007 01:31:31 AM (18 years ago)
- File:
-
- 1 edited
-
branches/2.3/wp-includes/wp-db.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/wp-includes/wp-db.php
r6110 r6443 16 16 class wpdb { 17 17 18 var $show_errors = true;18 var $show_errors = false; 19 19 var $num_queries = 0; 20 20 var $last_query; … … 150 150 array ('query' => $this->last_query, 'error_str' => $str); 151 151 152 $error_str = "WordPress database error $str for query $this->last_query"; 153 if ( $caller = $this->get_caller() ) 154 $error_str .= " made by $caller"; 155 error_log($error_str, 0); 156 157 // Is error output turned on or not.. 158 if ( !$this->show_errors ) 159 return false; 160 152 161 $str = htmlspecialchars($str, ENT_QUOTES); 153 162 $query = htmlspecialchars($this->last_query, ENT_QUOTES); 154 // Is error output turned on or not.. 155 if ( $this->show_errors ) { 156 // If there is an error then take note of it 157 print "<div id='error'> 158 <p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br /> 159 <code>$query</code></p> 160 </div>"; 161 } else { 162 return false; 163 } 163 164 // If there is an error then take note of it 165 print "<div id='error'> 166 <p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br /> 167 <code>$query</code></p> 168 </div>"; 164 169 } 165 170 … … 167 172 // Turn error handling on or off.. 168 173 169 function show_errors() { 170 $this->show_errors = true; 174 function show_errors( $show = true ) { 175 $errors = $this->show_errors; 176 $this->show_errors = $show; 177 return $errors; 171 178 } 172 179 173 180 function hide_errors() { 181 $show = $this->show_errors; 174 182 $this->show_errors = false; 183 return $show; 175 184 } 176 185
Note: See TracChangeset
for help on using the changeset viewer.