Changeset 1223910
- Timestamp:
- 08/18/2015 05:34:33 PM (11 years ago)
- Location:
- ecampaign/branches/maintenance
- Files:
-
- 7 edited
-
Ecampaign.class.php (modified) (6 diffs)
-
EcampaignField.class.php (modified) (1 diff)
-
EcampaignLog.class.php (modified) (2 diffs)
-
EcampaignTableView.class.php (modified) (7 diffs)
-
ecampaign.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
uk/MP.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ecampaign/branches/maintenance/Ecampaign.class.php
r478589 r1223910 173 173 $efield->name = $noun ; 174 174 175 $knownField = $this->cannedFields[$noun];175 $knownField = @$this->cannedFields[$noun]; 176 176 177 177 if (!isset($knownField)) … … 181 181 } 182 182 // attributes in template or form are allowed to overwrite canned attributes 183 $attributeMap = EcampaignField::parseAttributes( $knownField[1]." ".$parsedFields[3][$i]);183 $attributeMap = EcampaignField::parseAttributes(@$knownField[1]." ".$parsedFields[3][$i]); 184 184 185 185 $efield->label = isset($attributeMap['label']) ? $attributeMap['label'] : $knownField[0]; 186 186 $attributeMap['label'] = null ; // remove label attribute from HTML 187 187 188 $efield->save = $attributeMap['save']; $attributeMap['save'] = null;189 $efield->type = $attributeMap['type'];188 $efield->save =@ $attributeMap['save']; $attributeMap['save'] = null; 189 $efield->type = @$attributeMap['type']; 190 190 $efield->attributes = EcampaignField::serializeAttributes($attributeMap); 191 191 $efield->mandatory = $parsedFields[2][$i] == "*"; 192 192 $efield->value = $value = trim($parsedFields[4][$i]); 193 $efield->validator = $knownField[2];193 $efield->validator = @$knownField[2]; 194 194 195 195 if (!empty($value)) … … 201 201 if (empty($efield->value)) 202 202 { 203 $efield->value = $pageAttributes->$noun ;203 $efield->value = @$pageAttributes->$noun ; 204 204 } 205 205 … … 226 226 $nonce = wp_create_nonce('ecampaign'); 227 227 $postID = get_the_ID(); 228 $referer = @$_SERVER["HTTP_REFERER"]; 228 229 $hiddenFields = 229 230 "<input type='hidden' name='_ajax_nonce' value='{$nonce}' /> 230 <input type='hidden' name='referer' value='{$ _SERVER["HTTP_REFERER"]}'/>231 <input type='hidden' name='referer' value='{$referer}'/> 231 232 <input type='hidden' name='postID' value='{$postID}'/>"; 232 233 … … 392 393 $formList = unserialize($formListSerialized); 393 394 } 394 $oldFormSerialized = $formList[$formID];395 $oldFormSerialized = @$formList[$formID]; 395 396 if (!empty($oldFormSerialized)) 396 397 { … … 592 593 case self::sCampaignEmail : 593 594 $efield->isCustom =false ; 594 $html = $efield->definition ? "" : self::breakupEmail($efield->value);595 $html = @$efield->definition ? "" : self::breakupEmail($efield->value); 595 596 break ; 596 597 -
ecampaign/branches/maintenance/EcampaignField.class.php
r477036 r1223910 182 182 // if (preg_match("/[\\000-\\037<>]/", $target)) // probably inadequate 183 183 // throw new Exception(__("unexpected character in"). " $fieldName: ". $target); 184 return ( $field);184 return (@$field); 185 185 } 186 186 -
ecampaign/branches/maintenance/EcampaignLog.class.php
r478617 r1223910 89 89 $wpdb->insert(self::$tableName, array( 90 90 'state' => $state, 91 'visitorName' => self::ensureSet( $field->visitorName),92 'visitorEmail' => self::ensureSet( $field->visitorEmail),91 'visitorName' => self::ensureSet(@$field->visitorName), 92 'visitorEmail' => self::ensureSet(@$field->visitorEmail), 93 93 'address' => isset($field->postalAddress) ? $field->postalAddress->toString() : "", 94 'checkbox1' => $field->checkbox1 ? 1 : 0, //very nasty95 'checkbox2' => $field->checkbox2 ? 1 : 0,96 'target' => self::ensureSet( $field->target),94 'checkbox1' => @$field->checkbox1 ? 1 : 0, //very nasty 95 'checkbox2' => @$field->checkbox2 ? 1 : 0, 96 'target' => self::ensureSet(@$field->target), 97 97 'info' => isset($infoString) ? $infoString : $field->subject, 98 'postID' => (int) self::ensureSet( $field->postID) ));98 'postID' => (int) self::ensureSet(@$field->postID) )); 99 99 } 100 100 … … 280 280 { 281 281 $query = EcampaignTableView::createQuery(array("visitorEmail"=>$visitor,"offset"=>null)); 282 $uri = $_SERVER['SCRIPT_URL'] . "?$query" ;282 $uri = @$_SERVER['SCRIPT_URL'] . "?$query" ; 283 283 return "<a title='show all records that match $visitor' href='$uri'>$visitor</a>"; 284 284 } -
ecampaign/branches/maintenance/EcampaignTableView.class.php
r477215 r1223910 19 19 $viewControl->wrap("span", "class='ecinline'"); 20 20 21 $this->where = $this->visibleColumnSet['_where']; unset($this->visibleColumnSet['_where']);22 $this->from = $this->visibleColumnSet['_from']; unset($this->visibleColumnSet['_from']);23 $this->note = $this->visibleColumnSet['_note']; unset($this->visibleColumnSet['_note']);21 $this->where = @$this->visibleColumnSet['_where']; unset($this->visibleColumnSet['_where']); 22 $this->from = @$this->visibleColumnSet['_from']; unset($this->visibleColumnSet['_from']); 23 $this->note = @$this->visibleColumnSet['_note']; unset($this->visibleColumnSet['_note']); 24 24 25 25 $visibleColumnNames = new EcampaignString(array_keys($this->visibleColumnSet)); … … 31 31 } 32 32 33 $this->header = $header ;33 $this->header = @$header ; 34 34 35 35 $filterControls = new EcampaignString(); … … 40 40 { 41 41 case 'select' : 42 $this->addSelectFilterControl($filterControls, $columnSet, $field, $fieldPresentations[$field]);42 $this->addSelectFilterControl($filterControls, $columnSet, $field, @$fieldPresentations[$field]); 43 43 break ; 44 44 … … 132 132 function addHiddenFilter($columnName) 133 133 { 134 $filterValue = urldecode( $_GET[$columnName]);134 $filterValue = urldecode(@$_GET[$columnName]); 135 135 $this->where .= empty($filterValue) ? "" : " and $columnName = '$filterValue' " ; 136 136 } … … 159 159 $s->wrap("select", "name='$columnName'"); 160 160 $s->addTo($sb); 161 162 $this->where .= $selected == $all ? "" : " and $columnName = '$selected' " ; 161 $this->where .= empty($selected) ? "" : " and $columnName = '$selected' " ; 163 162 } 164 163 165 164 function addSearchBox($sb) 166 165 { 167 $search = urldecode( $_GET['search']);166 $search = urldecode(@$_GET['search']); 168 167 $sb->add("<label class=ecsearch for=s1>Search</label><input id=s1 class=ecsearch name=search type='text' value='$search' />"); // render search box 169 168 if (empty($search)) return ; 169 $where = '' ; 170 170 foreach ($this->visibleColumnSet as $column => $name) 171 171 { 172 $colWords = split("as", $column);173 $where .= " or $colWords[0] LIKE '%". mysql_real_escape_string($search)."%' ";172 $colWords = explode("as", $column); 173 $where .= " or $colWords[0] LIKE '%".esc_sql($search)."%' "; 174 174 } 175 175 $this->where .= " and (false $where)" ; … … 241 241 function addDeleteControl($sb, $totalRows) 242 242 { 243 $tables = split(" ", $this->from); // cannot delete rows selected in a multi table join243 $tables = explode(" ", $this->from); // cannot delete rows selected in a multi table join 244 244 if (count($tables) > 1) return ; 245 245 246 246 $q = $this->createQuery(array()); 247 247 248 if ( $_POST['delete'] == 'yes')248 if (@$_POST['delete'] == 'yes') 249 249 { 250 250 global $wpdb ; … … 350 350 function getTotalRows() 351 351 { 352 $totalRows = $_GET['totalRows'] ;352 $totalRows = @$_GET['totalRows'] ; 353 353 if (!is_numeric($totalRows)) 354 354 { -
ecampaign/branches/maintenance/ecampaign.php
r473668 r1223910 93 93 { 94 94 $log = new EcampaignLog(); 95 $log->write("exception", $ecampaign->field, $e->getMessage());95 $log->write("exception", @$ecampaign->field, $e->getMessage()); 96 96 $response = array("success" => false, "_ajax_nonce" => wp_create_nonce('ecampaign'), 97 97 "msg" => "Error: " . $e->getMessage() . ". " . __("This error has been logged! Sorry.")) ; … … 110 110 throw new Exception (__("Cannot open:$classFile")); 111 111 include_once $classFile ; 112 $classPath = split('/',$classPath); // loose the directory112 $classPath = explode('/',$classPath); // loose the directory 113 113 $class = $classPath[count($classPath)-1] ; 114 114 return new $class ; -
ecampaign/branches/maintenance/readme.txt
r478626 r1223910 79 79 or testing, directly in the top of wp-includes/class-phpmailer.php. 80 80 81 = Upgrading from 0.83 = 82 Very minor upgrade. 83 81 84 = Upgrading from 0.82 = 82 85 Minor upgrade. … … 141 144 142 145 == Changelog == 146 = 0.84 = 147 * Suppress some E_NOTICE messages 148 * Change UK/MP lookup mechanism. 143 149 144 150 = 0.83 = -
ecampaign/branches/maintenance/uk/MP.class.php
r1223820 r1223910 85 85 $target['email'] = $this->testMode->isDiverted() ? $this->fieldSet->campaignEmail : $memberEmail; 86 86 87 $this->log->write("lookup", $this->fieldSet, "$memberName\r\n$constituencyName\r\nsource:".$ source);87 $this->log->write("lookup", $this->fieldSet, "$memberName\r\n$constituencyName\r\nsource:".$biography['source']); 88 88 $response = array("target" => array($target), 89 89 "constituency" => $constituencyName, … … 161 161 try { 162 162 $biography = self::matchChain($regexBio, $page['body'], 'mixs'); 163 $biography['source'] = "[]" ; 163 164 } 164 165 catch (ErrorException $e)
Note: See TracChangeset
for help on using the changeset viewer.